Skip to content

CI

CI #83

Workflow file for this run

name: CI
on: workflow_dispatch
env:
# This is required to enable the web_sys clipboard API which egui_web uses
# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html
# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html
RUSTFLAGS: --cfg=web_sys_unstable_apis
jobs:
build_wasm:
name: Build Wasm
runs-on: ubuntu-latest
env:
BUILD: release
TARGET_NAME: graph_app
OUT_DIR: docs
steps:
- uses: actions/checkout@v2
with:
ref: deployment
token: ${{ github.token }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup target add wasm32-unknown-unknown
- name: Update deployment branch
run: |
git config --global user.email "[email protected]"
git config --global user.name github-actions
git pull -r origin main -Xtheirs
- uses: actions-rs/cargo@v1
with:
command: build
args: --${{ env.BUILD }} --lib --target wasm32-unknown-unknown
- uses: jetli/[email protected]
with:
version: 'latest'
- name: Run wasm-bindgen
run: |
wasm-bindgen "./target/wasm32-unknown-unknown/$BUILD/$TARGET_NAME.wasm" --out-dir ${{ env.OUT_DIR }} --no-modules --no-typescript
- name: Deploy
run: |
git add ${{ env.OUT_DIR }}
git commit -m 'Deploy'
git push -f
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: sudo apt-get update && sudo apt-get install libspeechd-dev libpango-1.0
- uses: actions-rs/cargo@v1
with:
command: check
check_wasm:
name: Check wasm32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- run: rustup target add wasm32-unknown-unknown
- uses: actions-rs/cargo@v1
with:
command: check
args: --lib --target wasm32-unknown-unknown