-
Notifications
You must be signed in to change notification settings - Fork 257
95 lines (82 loc) · 2.64 KB
/
Copy pathbuild-web.yaml
File metadata and controls
95 lines (82 loc) · 2.64 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
name: build-web
on:
workflow_call:
workflow_dispatch:
# We need consistent env vars across all workflows for the cache to work
env:
CARGO_TERM_COLOR: always
CLICOLOR_FORCE: 1
RUSTFLAGS: "-C debuginfo=0"
RUSTDOCFLAGS: "-Dwarnings"
jobs:
build-web:
runs-on: ubuntu-24.04
steps:
- name: 📂 Checkout code
uses: actions/checkout@v7
# Website requires Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3.2.1
- uses: baptiste0928/cargo-install@v3
with:
crate: mdbook
- uses: baptiste0928/cargo-install@v3
with:
crate: mdbook-footnote
- uses: baptiste0928/cargo-install@v3
with:
crate: wasm-pack
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- run: ./.github/workflows/scripts/set_version.sh
- name: 💰 Cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.version }}-${{ hashFiles('./Cargo.lock') }}
shared-key: web
save-if:
${{ github.ref == 'refs/heads/web' || github.ref ==
'refs/heads/main' }}
# Caching `~/.cargo/bin/` breaks the rustup `cargo`/`rustc` symlinks
# on the new macos-15 runner image — see
# https://github.com/Swatinem/rust-cache/issues/341.
cache-bin: "false"
- uses: go-task/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.53.1
- name: 🕷️ Build web
run: task web:build
- uses: actions/upload-pages-artifact@v5.0.0
with:
path: web/website/public/
build-codemirror-demo:
runs-on: ubuntu-24.04
steps:
- name: 📂 Checkout code
uses: actions/checkout@v7
- name: 🧅 Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install CodeMirror demo dependencies
working-directory: web/prql-codemirror-demo/
run: bun install
- name: Install Lezer dependencies
working-directory: grammars/prql-lezer/
run: bun install
- name: Build Lezer grammar
working-directory: grammars/prql-lezer/
run: bun run build
- name: Copy Lezer grammar into demo
working-directory: web/prql-codemirror-demo/
run: |
mkdir src/lang-prql/prql-lezer
cp ../../grammars/prql-lezer/dist/* src/lang-prql/prql-lezer/
- name: Build CodeMirror demo
working-directory: web/prql-codemirror-demo/
run: bun run build