Repository navigation
130 lines (112 loc) · 4.31 KB
/
Copy pathbuild.yaml
File metadata and controls
130 lines (112 loc) · 4.31 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
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@c8228d827a81b9f8c808825328af361c45461ba3
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@03c9f6b2d9c9fa2c26cfa22d0fa379a69329b319
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@10df15e12bbd1cc1cf48089f2e232349f98c74e7
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 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'