-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (40 loc) · 1.4 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: CI build-test-pack
on: [push, pull_request]
jobs:
build-and-test:
name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDKs
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test (net6.0)
run: dotnet test --no-restore --no-build --configuration Release --framework net6.0 --logger trx --results-directory "TestResults"
- name: Test (net481)
run: dotnet test --no-restore --no-build --configuration Release --framework net481 --logger trx --results-directory "TestResults"
if: matrix.os == 'windows-latest'
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: TestResults
path: TestResults
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Pack
run: dotnet pack --no-restore --no-build --configuration Release --version-suffix CI-$GITHUB_RUN_ID --output pkg
- name: Upload package
uses: actions/upload-artifact@v2
with:
name: ThumbHash-pkg
path: pkg/*.*