-
Notifications
You must be signed in to change notification settings - Fork 865
93 lines (78 loc) · 2.82 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
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: ci
on:
pull_request_target:
branches: [ main, feature/*, hotfix/* ]
push:
branches: [ main, feature/*, hotfix/* ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
environment: ci
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{ github.event.pull_request.head.repo.full_name }}
lfs: true
- uses: ./.github/actions/build
- run: npm run lint
shell: bash
working-directory: templates
- run: npm test
shell: bash
working-directory: templates
- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
id: test-net80
- run: dotnet test -c Release -f net6.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
if: matrix.os == 'ubuntu-latest'
id: test-net60
- run: npm i -g @percy/cli
if: matrix.os == 'ubuntu-latest'
- run: percy exec -- dotnet test -c Release -f net8.0 --filter Stage=Percy --no-build --collect:"XPlat Code Coverage"
if: matrix.os == 'ubuntu-latest'
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- run: echo "DOTNET_DbgEnableMiniDump=1" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'
- run: dotnet run -c Release --no-build -f net8.0 --project src/docfx -- docs/docfx.json
- run: dotnet run -c Release --no-build -f net8.0 --project src/docfx -- samples/seed/docfx.json --output docs/_site/seed
- uses: actions/upload-pages-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
path: docs/_site
- name: Upload Logs
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: logs-${{ matrix.os }}
path: |
msbuild.binlog
test/**/TestResults/*.trx
test/**/TestResults/*.html
- uses: actions/upload-artifact@v4
if: ${{ failure() && matrix.os == 'ubuntu-latest' }}
with:
name: dump
path: /tmp/coredump*
- name: Report failed tests
if: ${{ failure() && (steps.test-net80.outcome == 'failure' || steps.test-net60.outcome == 'failure') }}
uses: ./.github/actions/report-failed-tests
publish-docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: [test]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
actions: read
pages: write
id-token: write
steps:
- id: deployment
uses: actions/deploy-pages@v4