-
Notifications
You must be signed in to change notification settings - Fork 6
96 lines (84 loc) · 2.55 KB
/
flow.yml
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
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
name: Test (native)
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
platform:
- runs-on: ubuntu-latest
channel: linux
- runs-on: macos-latest
channel: mac
- runs-on: windows-latest
channel: windows
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install things
if: matrix.platform.channel == 'linux'
run: sudo apt-get update && sudo apt-get install -y libasound2-dev libudev-dev
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Test
run: cargo test --workspace
test-web:
name: Test (web)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: wasm32-unknown-unknown
- name: Test
run: cargo check --workspace --target wasm32-unknown-unknown
pages:
needs:
- test
- test-web
name: Pages
permissions:
contents: write
if: github.ref == 'refs/heads/main' && github.repository_owner == 'geng-engine'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
target: wasm32-unknown-unknown
- name: Install cargo-geng
run: |
cargo install cargo-geng --git https://github.com/geng-engine/cargo-geng
- name: Build examples
run: |
mkdir -p website/static/examples
examples_list="["
for example in examples/*; do
example=$(basename $example)
example=${example%.rs}
cargo geng build --release --platform web --package geng --example $example
mv target/geng website/static/examples/$example
examples_list="$examples_list\"$example\","
done
examples_list="$examples_list]"
echo "$examples_list"
sed -i "s|\\[\"this-will-be-populated-in-ci\"\\]|$examples_list|g" website/content/examples.md
- name: Deploy GitHub Pages
uses: shalzz/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_DIR: website