-
Notifications
You must be signed in to change notification settings - Fork 61
208 lines (174 loc) · 5.18 KB
/
Copy pathtests.yml
File metadata and controls
208 lines (174 loc) · 5.18 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
ssh_enabled:
type: boolean
description: "Run the build with ssh debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
test:
name: test-${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
SPY_WERROR: true
HYPOTHESIS_PROFILE: ci
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Checkout repository
uses: actions/checkout@v2
# - name: Install wasi-sdk
# run: |
# cd
# WASI_OS=linux
# WASI_ARCH=x86_64
# WASI_VERSION=24
# WASI_VERSION_FULL=${WASI_VERSION}.0
# WASI_FILENAME=wasi-sdk-${WASI_VERSION_FULL}-${WASI_ARCH}-${WASI_OS}
# wget -q https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/${WASI_FILENAME}.tar.gz
# tar xf ${WASI_FILENAME}.tar.gz
# $PWD/${WASI_FILENAME}/bin/clang --version
# echo "$PWD/${WASI_FILENAME}/bin" >> $GITHUB_PATH
- name: Display versions
run: |
echo PATH="$PATH"
echo
echo clang && clang --version && echo
echo gcc && gcc --version && echo
- name: Install system dependencies
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libgc-dev
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install bdw-gc
fi
- name: Set up uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Install venv
run: |
uv sync --locked
- name: Linter
run: |
uv run ruff check .
- name: Format check
run: |
uv run ruff format --check .
- name: Build libspy
run: |
cd spy/libspy
uv run make
- name: Run tests
run: |
uv run pytest -n auto -m "not mypy" --junit-xml=test-results.xml
- name: Run mypy
run: |
uv run mypy
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
path: test-results.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results
pyodide-test:
name: pyodide-test-${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
SPY_WERROR: true
HYPOTHESIS_PROFILE: ci
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Checkout repository
uses: actions/checkout@v2
- name: Display versions
run: |
echo PATH="$PATH"
echo
echo clang && clang --version && echo
echo gcc && gcc --version && echo
- name: Install system dependencies
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
sudo apt-get update && sudo apt-get install -y libgc-dev
elif [ "$RUNNER_OS" = "macOS" ]; then
brew install bdw-gc
fi
- name: Set up uv
uses: astral-sh/setup-uv@v8.1.0
with:
enable-cache: true
- name: Install venv
run: |
uv sync --locked
- name: Linter
run: |
uv run ruff check .
- name: Format check
run: |
uv run ruff format --check .
- name: Install EMCC
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 6.0.4
./emsdk activate 6.0.4
source ./emsdk_env.sh
echo "$PWD/upstream/emscripten" >> $GITHUB_PATH
echo "EMSDK=$PWD" >> $GITHUB_ENV
- name: Install pyodide
run: |
npm --prefix pyodide install
- name: Create pyodide venv
# needed by test_cli::test_execute_pyodide, which otherwise is silently
# skipped. The `pyodide` command comes from pyodide-build, see
# pyodide/README.md
run: |
cd pyodide
uv run pyodide venv venv
./venv/bin/pip install -e ..
- name: Build libspy
run: |
cd spy/libspy
uv run make
- name: Run tests
run: |
uv run pytest -n auto -m pyodide --junit-xml=pyodide-test-results.xml
# - name: Run mypy
# run: |
# mypy
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
path: pyodide-test-results.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results