-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (86 loc) · 2.92 KB
/
test.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Test
on:
push:
branches: ['main']
pull_request:
# The branches below should be a subset of the branches above
branches: ['main']
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
test:
name: Build on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
dotnet_version: [8.0.x]
steps:
- name: Install MacPorts
if: ${{ matrix.os == 'macos-latest' }}
uses: melusina-org/setup-macports@v1
- name: Install icu4c on macOS
if: ${{ matrix.os == 'macos-latest' }}
run: sudo port -v install icu
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet_version }}
- name: Read package.json
id: package_json
uses: zoexx/[email protected]
with:
file_path: 'package.json'
- name: Install Node.js and NPM
uses: actions/setup-node@v4
with:
node-version: ${{ fromJson(steps.package_json.outputs.volta).node }}
cache: npm
- name: Install packages
run: npm ci
- name: type checking
run: npm run typecheck
- name: Build
run: npm run build
- name: Verify files changed after build
id: verify-changed-files
uses: tj-actions/verify-changed-files@v20
- name: Report file changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
env:
CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }}
run: |
echo "Error - changed files after build: $CHANGED_FILES"
exit 1
- name: dotnet unit tests
run: dotnet test c-sharp-tests/c-sharp-tests.csproj
- name: npm unit tests
run: npm test
- name: check dotnet formatting
run: |
cd c-sharp
dotnet tool restore
dotnet csharpier --check .
- name: check JS/TS formatting
run: npm run format:check
- name: check JS/TS linting
run: npm run lint
- name: check packaging
env:
# no hardlinks so dependencies are copied
USE_HARD_LINKS: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run package
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true