Merge pull request #3 from hellstackdev/renovate/pin-dependencies #10
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: .NET CI | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| # Cache the built artifacts for use in other workflows | |
| - name: Cache build outputs | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: | | |
| BCFileDecryptor/bin/Release | |
| BCFileDecryptorTests/bin/Release | |
| key: ${{ runner.os }}-build-${{ github.sha }} | |
| restore-keys: | | |
| ${{ runner.os }}-build- | |
| # Upload build artifacts for the test job | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| BCFileDecryptor/bin/Release | |
| BCFileDecryptorTests/bin/Release | |
| retention-days: 1 | |
| test: | |
| name: Test | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| # Download build artifacts from the build job | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| name: build-artifacts | |
| path: ./ | |
| # Run tests using the built artifacts | |
| - name: Run tests | |
| run: dotnet test --no-build --verbosity normal --configuration Release |