Repository navigation
161 lines (141 loc) · 5.94 KB
/
Copy pathbuild.yaml
File metadata and controls
161 lines (141 loc) · 5.94 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
name: Build Status
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
checks: write
pull-requests: write
jobs:
build:
strategy:
fail-fast: false
matrix:
template:
- python
- cython
- cpp
- cpp-capi
- js
- jupyter
- rust
- rust-capi
- rustjswasm
- cppjswasm
- cppjswasm-capi
- uitk-svelte
- uitk-webawesome
- site-react
- site-sveltekit
- site-webawesome
os:
- ubuntu-24.04
- macos-latest
exclude:
- template: uitk-svelte
os: macos-latest
- template: uitk-webawesome
os: macos-latest
- template: site-react
os: macos-latest
- template: site-sveltekit
os: macos-latest
- template: site-webawesome
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create fixture files
run: |
# python
touch pyproject.toml
# node
echo '{"name": "a", "version": "0.0.0", "scripts": {}}' > package.json
printf 'lockfileVersion: '9.0'\nsettings:\n\tautoInstallPeers: true\n\texcludeLinksFromLockfile: false\nimporters:\n.: {}' > pnpm-lock.yaml
# rust
printf '[package]\nname = "rust"\nversion = "0.1.0"\nedition = "2021"\n[dependencies]\n' > Cargo.toml
mkdir -p src
printf 'fn main() {\n println!("Hello, world!");\n}\n' > src/main.rs
- name: Setup Python
uses: actions-ext/python/setup@d8fa97566b70553350d6745e8b0a62db2e3c9cae
with:
version: '3.11'
- name: Install Copier
run: uv pip install copier
- name: Install clang-format
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get install -y clang-format
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install clang-format
fi
if: matrix.template == 'cpp' || matrix.template == 'cpp-capi' || matrix.template == 'cppjswasm' || matrix.template == 'cppjswasm-capi'
- name: Setup Node.js
uses: actions-ext/node/setup@fa3d2968f7a1d39cecd5d2062fe40c8ca5a0e6d5
with:
version: 22.x
pnpm_version: 11.11.0
js_folder: "."
if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || matrix.template == 'cppjswasm-capi' || matrix.template == 'rustjswasm' || matrix.template == 'uitk-svelte' || matrix.template == 'uitk-webawesome' || matrix.template == 'site-react' || matrix.template == 'site-sveltekit' || matrix.template == 'site-webawesome'
- name: Setup Rust
uses: actions-ext/rust/setup@af6343171cd1a86c4183da96de7eb96e15599662
if: matrix.template == 'rust' || matrix.template == 'rust-capi' || matrix.template == 'rustjswasm'
- name: Install JavaScript dependencies
run: pnpm install
if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || matrix.template == 'cppjswasm-capi' || matrix.template == 'rustjswasm'
- name: Build Rust fixture
run: cargo build
if: matrix.template == 'rust' || matrix.template == 'rust-capi' || matrix.template == 'rustjswasm'
- name: Generate template
run: make gen-${{ matrix.template }}
- name: Install JavaScript template dependencies and browser
run: |
cd ../javascript-template-${{ matrix.template }}
pnpm install
pnpm exec playwright install --with-deps chromium
if: matrix.template == 'uitk-svelte' || matrix.template == 'uitk-webawesome' || matrix.template == 'site-react' || matrix.template == 'site-sveltekit' || matrix.template == 'site-webawesome'
- name: Test template
run: make test-${{ matrix.template }}
- name: Check types with Pyodide enabled
run: |
copier copy --defaults --vcs-ref=$(git rev-parse HEAD) . ../python-template-${{ matrix.template }}-pyodide --data-file examples/${{ matrix.template }}.yaml --data add_pyodide=true
make -C ../python-template-${{ matrix.template }}-pyodide check-types
if: matrix.template == 'rust' || matrix.template == 'rustjswasm'
- name: Check source distribution artifacts
run: python .github/scripts/check_sdist_artifacts.py ../python-template-${{ matrix.template }}
env:
HATCH_BUILD_NO_HOOKS: '1'
if: matrix.template == 'cpp' || matrix.template == 'cpp-capi' || matrix.template == 'cppjswasm' || matrix.template == 'cppjswasm-capi' || matrix.template == 'rust' || matrix.template == 'rust-capi' || matrix.template == 'rustjswasm'
- name: Test alternate native wheel ABI
if: startsWith(matrix.template, 'cpp') || startsWith(matrix.template, 'rust')
shell: bash
env:
TEMPLATE: ${{ matrix.template }}
SKIP_HATCH_JS: '1'
run: |
if [[ "$TEMPLATE" == cpp* ]]; then
abi3=true
tag=abi3
test_python=3.13
else
abi3=false
tag=cp312
test_python=3.12
fi
project="$RUNNER_TEMP/abi-test"
copier copy --defaults --vcs-ref=HEAD . "$project" --data-file "examples/$TEMPLATE.yaml" \
-d project_name=abi_test -d python_version_primary=3.12 -d use_abi3="$abi3" -d add_vcpkg=false
uv build --python 3.12 "$project"
wheel=("$project"/dist/*-cp312-"$tag"-*.whl)
uv run --isolated --no-project --python "$test_python" --with "${wheel[0]}" --with pytest pytest --pyargs abi_test