-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.08 KB
/
build.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
name: Build and test
on:
push:
tags:
- "v*"
branches:
- main
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dtolnay/[email protected]
- name: get-cmake
uses: lukka/get-cmake@latest
- uses: jetli/[email protected]
with:
version: "v0.12.1"
- uses: pnpm/action-setup@v4
- name: Check
run: |
rustup component add clippy
cargo clippy --no-deps
- name: npm dependencies
run: pnpm install
- name: Build
run: cargo build --features schema,trace,builder --release
- name: Test Rust
run: cargo test --features schema,trace,builder
- name: Build WASM
run: |
wasm-pack build --release --target nodejs --reference-types --features wasm,builder --no-default-features
cp target/schemas/out/*.xsdb pkg/xwasser-v070.xsdb.bin
cp crates/codelists/public/V0_7_0/codelist.json pkg/codelist.json
cp package.tmp.json pkg/package.json
pnpm tsup --format esm,cjs
- name: Test WASM
run: pnpm test
- name: Archive NPM package
uses: actions/upload-artifact@v4
with:
name: xoev-xwasser-pkg
path: ./pkg
- name: Build WASM Web
run: |
wasm-pack build --release --target web --reference-types --features wasm,builder --no-default-features
cp target/schemas/out/*.xsdb pkg/xwasser-v070.xsdb.bin
cp crates/codelists/public/V0_7_0/codelist.json pkg/codelist.json
cp package.tmp.web.json pkg/package.json
- name: Build utils web package
run: pnpm tsup --format esm,cjs
- name: Archive NPM web package
uses: actions/upload-artifact@v4
with:
name: xoev-xwasser-pkg-web
path: ./pkg
publish:
if: startsWith( github.ref, 'refs/tags/v' )
uses: ./.github/workflows/publish.yaml
needs: build-and-test
secrets: inherit