[PULL REQUEST] Rewrite the main program and some fixes #13
This file contains 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: Build USSR | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- "**/*.md" | |
- "**/*.gitignore" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dotnet-version: [ '6.0.x', '7.0.x' ] | |
dotnet-framework: [ 'net6.0', 'net7.0' ] | |
dotnet-runtime: [ 'win-x64', 'win-x86', 'linux-x64', 'linux-arm', 'linux-arm64', 'osx-x64' ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET ${{ matrix.dotnet-version }} | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
dotnet-quality: ga | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build -c Release --no-restore | |
- name: Test | |
run: dotnet test --logger trx --results-directory ${{ github.workspace }}/TestResults-${{ matrix.dotnet-framework }}-${{ matrix.dotnet-runtime }} --no-restore --verbosity normal | |
- name: Report test | |
uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: test-results-${{ matrix.dotnet-framework }} | |
path: ${{ github.workspace }}/TestResults-${{ matrix.dotnet-framework }}-${{ matrix.dotnet-runtime }} | |
- name: Publish | |
run: dotnet publish -c Release --framework ${{ matrix.dotnet-framework }} --runtime ${{ matrix.dotnet-runtime }} --no-self-contained | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v3 | |
with: | |
name: USSR-${{ matrix.dotnet-framework }}-latest | |
path: ${{ github.workspace }}/bin/Release/${{ matrix.dotnet-framework }}/${{ matrix.dotnet-runtime }}/publish/ |