Change build job #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build, Test and Release | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| types: | |
| - opened | |
| - synchronize | |
| paths-ignore: | |
| - CHANGELOG.md | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - CHANGELOG.md | |
| - .github/** | |
| tags: [v*] | |
| env: | |
| buildFolderName: output | |
| buildArtifactName: output | |
| testResultFolderName: testResults | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set safe directory | |
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Build and Package Module' | |
| uses: ./.github/actions/build | |
| test-linux: | |
| name: Test on Linux | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Test on Linux' | |
| uses: ./.github/actions/run-tests | |
| test-win: | |
| name: Test on Windows | |
| runs-on: windows-latest | |
| needs: | |
| - build | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Test on Windows' | |
| uses: ./.github/actions/run-tests | |
| code-coverage: | |
| name: Publish Code Coverage | |
| if: success() || failure() | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - test-linux | |
| - test-win | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Publish Code Coverage' | |
| uses: ./.github/actions/code-coverage | |
| release: | |
| if: success() && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - test-linux | |
| - test-win | |
| - code-coverage | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Build Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ env.buildArtifactName }} | |
| path: ${{ env.buildFolderName }} | |
| - name: Publish Release | |
| shell: pwsh | |
| run: Import-Module ./output/RequiredModules/PowerShellForGitHub; ./build.ps1 -tasks publish | |
| env: | |
| GitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| GalleryApiToken: ${{ secrets.BICEP_PSGALLERY_KEY }} | |
| - name: Send Changelog PR | |
| shell: pwsh | |
| run: ./build.ps1 -tasks Create_ChangeLog_GitHub_PR | |
| env: | |
| GitHubToken: ${{ secrets.GITHUB_TOKEN }} |