Skip to content

Nix Flake + dev shell #12

Nix Flake + dev shell

Nix Flake + dev shell #12

Workflow file for this run

name: Test and deploy
on:
push:
branches: [ master ]
paths:
- "emu/**"
- "emu-wasm/**"
- "lib/**"
pull_request:
branches: [ master ]
paths:
- "emu/**"
- "emu-wasm/**"
- "lib/**"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Verify that the debugger compiles
run: cargo build --manifest-path emu/Cargo.toml --features debug
deploy:
name: Deploy WASM emulator
if: github.ref == 'refs/heads/master'
needs:
- test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./emu-wasm
steps:
- uses: actions/checkout@v2
- uses: jetli/wasm-pack-action@v0.3.0
with:
version: 'latest'
- uses: actions/setup-node@v2
with:
node-version: '12'
- name: Build WASM
run: wasm-pack build
- name: Install dependencies
run: cd ./www && npm install
- name: Build web app
run: cd ./www && npm run build
- name: Deploy to GH pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./emu-wasm/www/dist