CI #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
test: | |
name: Test Suite | |
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 install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev # egui_glium dependencies | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --lib | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- run: rustup component add rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- run: rustup component add clippy | |
- run: sudo apt-get update && sudo apt-get install libspeechd-dev libgtk-3-dev | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy |