Repository navigation
136 lines (117 loc) · 4.7 KB
/
Copy pathbuild.yaml
File metadata and controls
136 lines (117 loc) · 4.7 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
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
- js
- jupyter
- rust
- rustjswasm
- cppjswasm
- uitk-svelte
- uitk-webawesome
- site-react
- site-sveltekit
- site-webawesome
os:
- ubuntu-latest
- 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@c7ef9cbf13bc854a8d1422e9f8c6ee7a7ce1b911
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-14
sudo ln -sf /usr/bin/clang-format-14 /usr/bin/clang-format
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install clang-format
fi
if: matrix.template == 'cpp' || matrix.template == 'cppjswasm'
- name: Setup Node.js
uses: actions-ext/node/setup@8bcebee998923fcc26f5854b4fd05ea378b58262
with:
version: 22.x
pnpm_version: 11.11.0
js_folder: "."
if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || 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 == 'rustjswasm'
- name: Install JavaScript dependencies
run: pnpm install
if: matrix.template == 'js' || matrix.template == 'jupyter' || matrix.template == 'cppjswasm' || matrix.template == 'rustjswasm'
- name: Build Rust fixture
run: cargo build
if: matrix.template == 'rust' || 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 == 'cppjswasm' || matrix.template == 'rust' || matrix.template == 'rustjswasm'