Skip to content

Commit

Permalink
Added GitHub action for building & testing (#1)
Browse files Browse the repository at this point in the history
* Added CODEOWNERS file

* Added action for creating releases
  • Loading branch information
MorpheusXAUT authored Aug 2, 2022
1 parent 7456835 commit dbe68c2
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @MorpheusXAUT
64 changes: 64 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: MSBuild

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
SOLUTION_FILE_PATH: IASsure.sln

BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x86

permissions:
contents: read
issues: read
checks: write
pull-requests: write

jobs:
build-and-test:
runs-on: windows-latest
name: "Build and test"

steps:
- uses: actions/checkout@v3

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Test
uses: microsoft/[email protected]
with:
testAssembly: 'IASsureTest.dll'
searchFolder: '${{env.BUILD_CONFIGURATION}}/'

- name: Upload plugin DLL artifact
uses: actions/upload-artifact@v3
with:
name: plugin-dll
path: '${{env.BUILD_CONFIGURATION}}/IASsure.dll'

publish-test-results:
runs-on: windows-latest
name: "Publish Tests Results"
needs: build-and-test

if: success() || failure()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
trx_files: "artifacts/**/*.trx"
99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release

on:
push:
tags: [ "v*.*.*" ]

env:
SOLUTION_FILE_PATH: IASsure.sln

BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x86

permissions:
contents: write
issues: read
checks: write
pull-requests: write

jobs:
build-and-test:
runs-on: windows-latest
name: "Build and test"

steps:
- uses: actions/checkout@v3

- name: Add MSBuild to PATH
uses: microsoft/[email protected]

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Test
uses: microsoft/[email protected]
with:
testAssembly: 'IASsureTest.dll'
searchFolder: '${{env.BUILD_CONFIGURATION}}/'

- name: Upload plugin DLL artifact
uses: actions/upload-artifact@v3
with:
name: plugin-dll
path: '${{env.BUILD_CONFIGURATION}}/IASsure.dll'

publish-test-results:
runs-on: windows-latest
name: "Publish Tests Results"
needs: build-and-test

if: success() || failure()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
trx_files: "artifacts/**/*.trx"

release:
runs-on: ubuntu-latest
name: "Release"
needs: [build-and-test, publish-test-results]

steps:
- uses: actions/checkout@v3

- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: plugin-dll

- name: Create Archive
run: zip IASsure_${{github.ref_name}}.zip IASsure.dll README.md LICENSE

- name: Create checksums.txt
run: sha256sum IASsure_${{github.ref_name}}.zip > checksums.txt

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Sign checksums.txt
run: gpg --output checksums.txt.sig --detach-sig checksums.txt

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
IASsure_${{github.ref_name}}.zip
checksums.txt
checksums.txt.sig

0 comments on commit dbe68c2

Please sign in to comment.