-
Notifications
You must be signed in to change notification settings - Fork 681
88 lines (71 loc) · 2.27 KB
/
ci-build-test.yml
File metadata and controls
88 lines (71 loc) · 2.27 KB
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
name: Build and Test
on:
# Manual trigger
workflow_dispatch:
# Run CI for all pushes to main
push:
branches: ["main"]
# Run CI for pull requests to all branches, but only if code changed
pull_request:
paths:
- ".github/workflows/ci-*.yml"
- "*.sln"
- "*.props"
- "Makefile"
- "global.json"
- "package.json"
- "package-lock.json"
- "src/**"
- "tests/**"
- "samples/**"
- "docs/**"
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
configuration: [Debug, Release]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: 📥 Clone the repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: 🔧 Set up .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0
with:
dotnet-version: |
10.0.x
9.0.x
- name: 🔧 Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '20'
- name: 📦 Install pinned npm dependencies for tests
run: npm ci
- name: 🏗️ Build
run: make build CONFIGURATION=${{ matrix.configuration }}
- name: 🧪 Test
run: make test CONFIGURATION=${{ matrix.configuration }}
- name: 🧪 AOT Compatibility
if: matrix.configuration == 'Release'
run: make test-aot CONFIGURATION=${{ matrix.configuration }}
- name: 📦 Pack
if: matrix.configuration == 'Release'
run: make pack CONFIGURATION=${{ matrix.configuration }}
- name: 📚 Generate docs
run: make generate-docs CONFIGURATION=${{ matrix.configuration }}
- name: 📤 Upload test results artifact
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: testresults-${{ matrix.os }}-${{ matrix.configuration }}
path: artifacts/testresults/**
publish-coverage:
if: github.actor != 'dependabot[bot]'
needs: build
uses: ./.github/workflows/ci-code-coverage.yml
secrets: inherit