-
Notifications
You must be signed in to change notification settings - Fork 7
147 lines (137 loc) · 3.96 KB
/
unit_test.yaml
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
name: Unit test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk-*"
workflow_dispatch:
defaults:
run:
shell: bash
env:
UV_VERSION: 0.2.2
jobs:
unit_test:
name: Unit test [py${{ matrix.python }} ${{ matrix.c_compiler }} ${{ matrix.os }}]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
##############
# Windows
- os: windows-2019
python: '3.12'
- os: windows-2022
python: '3.12'
##############
# Mac
# macos-x86_64
- os: macos-12
python: '3.12'
# macos-arm64
- os: macos-14
python: '3.12'
##############
# Ubuntu 24.04
- os: ubuntu-24.04
python: '3.9'
c_compiler: gcc-13
cxx_compiler: g++-14
- os: ubuntu-24.04
python: '3.10'
c_compiler: gcc-14
cxx_compiler: g++-14
- os: ubuntu-24.04
python: '3.11'
c_compiler: clang-16
cxx_compiler: clang++-16
- os: ubuntu-24.04
python: '3.12'
c_compiler: clang-17
cxx_compiler: clang++-17
- os: ubuntu-24.04
python: '3.12'
c_compiler: clang-18
cxx_compiler: clang++-18
##############
# Ubuntu 22.04
- os: ubuntu-22.04
python: '3.9'
c_compiler: gcc-11
cxx_compiler: g++-11
- os: ubuntu-22.04
python: '3.10'
c_compiler: gcc-12
cxx_compiler: g++-12
- os: ubuntu-22.04
python: '3.11'
c_compiler: clang-13
cxx_compiler: clang++-13
- os: ubuntu-22.04
python: '3.12'
c_compiler: clang-14
cxx_compiler: clang++-14
- os: ubuntu-22.04
python: '3.12'
c_compiler: clang-15
cxx_compiler: clang++-15
##############
# Ubuntu 20.04
- os: ubuntu-20.04
python: '3.9'
c_compiler: gcc-10
cxx_compiler: g++-10
- os: ubuntu-20.04
python: '3.10'
c_compiler: clang-10
cxx_compiler: clang++-10
- os: ubuntu-20.04
python: '3.11'
c_compiler: clang-11
cxx_compiler: clang++-11
- os: ubuntu-20.04
python: '3.12'
c_compiler: clang-12
cxx_compiler: clang++-12
steps:
- uses: actions/[email protected]
with:
path: code
- name: Set up Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Install uv
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/${{ env.UV_VERSION }}/uv-installer.sh | bash
- name: Install prereqs
run: 'uv pip install -r code/.github/requirements-test.txt --only-binary :all: --system --reinstall'
- name: Set Linux compiler
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
echo "CC=${{ matrix.c_compiler }}" >> "$GITHUB_ENV"
echo "CXX=${{ matrix.cxx_compiler }}" >> "$GITHUB_ENV"
- name: Configure
run: cmake -S code -B build
- name: Build
run: cmake --build build -j 6 --config Release
- if: runner.os == 'Windows'
name: Copy pyd files
run: cp ./gsd/Release/*.pyd gsd/
working-directory: build
- name: Run tests
run: python3 -m pytest --pyargs gsd -p gsd.pytest_plugin_validate --validate -v --log-level=DEBUG
env:
PYTHONPATH: ${{ github.workspace }}/build
# This job is used to provide a single requirement for branch merge conditions.
tests_complete:
name: Unit test
if: always()
needs: [unit_test]
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0