-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bayu Satiyo <[email protected]>
- Loading branch information
1 parent
a6de1ac
commit cc1cb9c
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |