Skip to content

Commit

Permalink
Add build workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Bayu Satiyo <[email protected]>
  • Loading branch information
kiraio-moe committed Jul 28, 2023
1 parent a6de1ac commit cc1cb9c
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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', '8.0.x']

steps:
- uses: actions/checkout@v3
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: .NET version
run: dotnet --version
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Test Report
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: test-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}

# uses: dorny/test-reporter@v1
# if: success() || failure()
# with:
# artifact: test-results-${{ matrix.dotnet-version }}
# name: Test Result ${{ matrix.dotnet-version }}
# path: TestResults-${{ matrix.dotnet-version }}
# reporter: dotnet-trx
- name: Publish
run: dotnet publish -c Release -o ${{ env.DOTNET_ROOT }}/USSR-dotnet${{ matrix.dotnet-version }}
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: USSR-dotnet${{ matrix.dotnet-version }}
path: ${{ env.DOTNET_ROOT }}/USSR-dotnet${{ matrix.dotnet-version }}

0 comments on commit cc1cb9c

Please sign in to comment.