-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (90 loc) · 2.68 KB
/
publisher_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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Publisher Build & Test
on: push
jobs:
ci:
name: Build & Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./publisher
env:
DOTNET_VERSION: 8.0.100-preview.7.23376.3
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Tool Restore
run: dotnet tool restore
- name: Restore
run: dotnet restore
- name: Check formatting
run: dotnet csharpier . --check
- name: Build
run: dotnet build --no-restore
- name: Test Publisher
run: >
dotnet test ./test/LeanPipe.Tests/LeanPipe.Tests.csproj
--no-build
--collect "XPlat Code Coverage"
--settings test/coverlet.runsettings
--logger trx
--results-directory TestResults
- name: Test test client
run: >
dotnet test ./test/LeanPipe.TestClient.Tests/LeanPipe.TestClient.Tests.csproj
--no-build
--collect "XPlat Code Coverage"
--settings test/coverlet.runsettings
--logger trx
--results-directory TestResults
- name: Integration test
run: >
dotnet test ./test/LeanPipe.IntegrationTests/LeanPipe.IntegrationTests.csproj
--no-build
--collect "XPlat Code Coverage"
--settings test/coverlet.runsettings
--logger trx
--results-directory TestResults
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: publisher_test_results.zip
path: publisher/TestResults/*.trx
publish-test-results:
name: Publish Tests Results
needs: ci
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
pull-requests: write
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Extract Artifacts
run: |
for file in artifacts/*.zip; do
if [[ -f "$file" ]]; then
dir="${file%.zip}"
mkdir -p "$dir"
unzip -d "$dir" "$file"
fi
done
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
trx_files: "artifacts/*/**/*.trx"