-
Notifications
You must be signed in to change notification settings - Fork 25
144 lines (136 loc) · 4.61 KB
/
build.yml
File metadata and controls
144 lines (136 loc) · 4.61 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
name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
env:
CARGO_TERM_COLOR: always
jobs:
x86-64-linux-build-and-test:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: desktop-${{ runner.os }}-linux-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get clean && sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev libasound2-dev libgtk-3-dev
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build
run: cargo build --target x86_64-unknown-linux-gnu --verbose
- name: Run tests
run: cargo test --target x86_64-unknown-linux-gnu --verbose
wasm32-build-and-test:
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: web-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
# https://github.com/rust-lang/rust/issues/131960
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- run: cargo install --force wasm-bindgen-cli --version 0.2.114
- name: Install wasm Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get clean && sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev
- name: Cache npm dependencies
uses: actions/cache@v3
with:
path: www/node_modules
key: npm-${{ runner.os }}-${{ hashFiles('www/package-lock.json') }}
- name: Install node dependencies
run: (cd www && npm install)
- name: Build
run: ./.github/build.sh
- name: Install Playwright browsers
run: cd www && npx playwright install --with-deps chromium
- name: Run Playwright tests
run: cd www && npx playwright test
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: www/playwright-report/
retention-days: 30
- name: Upload Playwright snapshots
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-snapshots
path: www/tests/**/*-snapshots/
retention-days: 30
wasm32-publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: web-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
# https://github.com/rust-lang/rust/issues/131960
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- run: cargo install --force wasm-bindgen-cli --version 0.2.114
- name: Install wasm Rust target
run: rustup target add wasm32-unknown-unknown
- name: Install system dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get clean && sudo apt-get update
sudo apt-get install -y pkg-config libudev-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev
- name: Install node dependencies
run: (cd www && npm install)
- name: Build
run: ./.github/build.sh --release
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: www/dist/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4