-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (100 loc) · 3.5 KB
/
ci.yml
File metadata and controls
117 lines (100 loc) · 3.5 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
quality:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: Linux QA
run-windows-smoke: false
- os: windows-latest
label: Windows smoke
run-windows-smoke: true
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
env:
CS_ACCESS_TOKEN: ${{ secrets.CS_ACCESS_TOKEN }}
CODESCENE_CLI_SHA256: ${{ vars.CODESCENE_CLI_SHA256 }}
steps:
- name: Check out repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
- name: Set up Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b
- name: Install CLI tools
if: matrix.run-windows-smoke == false
run: |
for tool in mbake ty ruff; do uv tool install ${tool}; done
npm install -g markdownlint-cli2
- name: Install make
if: matrix.run-windows-smoke
shell: pwsh
run: choco install make --no-progress -y
- name: Validate Makefile
if: matrix.run-windows-smoke == false
run: mbake validate Makefile
- name: Install code
if: matrix.run-windows-smoke == false
run: make build
- name: Check formatting
if: matrix.run-windows-smoke == false
run: make check-fmt
- name: Run ruff
if: matrix.run-windows-smoke == false
run: make lint
- name: Run typechecker
if: matrix.run-windows-smoke == false
run: make typecheck
- name: Run tests with coverage
if: matrix.run-windows-smoke == false
run: |
uv pip install slipcover pytest-forked
uv run python -m slipcover \
--source=./cmd_mox \
--omit="*/unittests/*,*/.venv/*" \
--branch \
--out coverage.xml \
-m pytest --forked -v cmd_mox/unittests
- name: Upload coverage artifact
if: matrix.run-windows-smoke == false
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.0.0
with:
name: coverage
path: coverage.xml
- name: Install CodeScene Coverage CLI
if: matrix.run-windows-smoke == false && env.CS_ACCESS_TOKEN != ''
run: |
curl -fsSL https://downloads.codescene.io/enterprise/cli/install-cs-coverage-tool.sh | bash -s -- -y
if [ -n "${CODESCENE_CLI_SHA256:-}" ]; then
echo "${CODESCENE_CLI_SHA256} install-cs-coverage-tool.sh" | sha256sum -c -
fi
- name: Upload coverage to CodeScene
if: matrix.run-windows-smoke == false && env.CS_ACCESS_TOKEN != ''
run: |
if [ ! -f coverage.xml ]; then
echo "coverage.xml not found!"
exit 1
fi
cs-coverage upload \
--format "cobertura" \
--metric "line-coverage" \
coverage.xml
- name: Run Windows smoke tests
if: matrix.run-windows-smoke
shell: pwsh
run: make windows-smoke
- name: Upload IPC logs
if: matrix.run-windows-smoke && always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.0.0
with:
name: windows-ipc-logs
path: windows-ipc.log
if-no-files-found: warn