Working about reach many the goals added one by one #34
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET class library | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| name: Build NuGet | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Get the name | |
| run: echo "REPOSITORY_URLNAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Get common repo | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: defra-cdp-sandpit/cdp-workflows | |
| path: temp_scripts | |
| - name: Build | |
| run: dotnet build ./${{ env.REPOSITORY_URLNAME }}/${{ env.REPOSITORY_URLNAME }}.csproj --no-dependencies --output build | |
| - name: Test | |
| run: dotnet test ./${{ env.REPOSITORY_URLNAME }}.sln --no-build --verbosity normal | |
| - name: Remove nuget.config so that writable source can be added afresh | |
| run: | | |
| rm -rf nuget.config | |
| - name: Cleanup - remove nuget.config as it contains sensitive info | |
| if: always() | |
| run: | | |
| bash temp_scripts/scripts/remove_nuget_config.sh |