Skip to content

refactor

refactor #499

Workflow file for this run

name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
x86-64-linux-build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
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: dtolnay/rust-toolchain@stable
- 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-serve:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: web-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
- uses: dtolnay/rust-toolchain@stable
- run: command -v wasm-pack >/dev/null 2>&1 || cargo install --force --git https://github.com/rustwasm/wasm-pack.git --tag v0.12.1
- 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 and publish
run: ./.github/publish.sh
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: www/dist/
single_commit: true