2021-06-21 22:41:48 +01:00
|
|
|
name: test and deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: jetli/wasm-pack-action@v0.3.0
|
|
|
|
|
|
|
|
- name: Build Rust for WASM
|
|
|
|
run: wasm-pack build
|
|
|
|
|
|
|
|
- name: Test WASM on Firefox
|
|
|
|
run: wasm-pack test --firefox --headless
|
|
|
|
|
|
|
|
- name: Test WASM on Chrome
|
|
|
|
run: wasm-pack test --chrome --headless
|
|
|
|
|
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
|
|
|
|
- name: Install Node Modules
|
|
|
|
run: npm ci
|
2021-06-21 22:46:38 +01:00
|
|
|
working-directory: ./www
|
2021-06-21 22:41:48 +01:00
|
|
|
|
|
|
|
- name: Build Js
|
|
|
|
run: npm run build --if-present
|
2021-06-21 22:46:38 +01:00
|
|
|
working-directory: ./www
|
2021-06-21 22:41:48 +01:00
|
|
|
|
|
|
|
- name: Deploy To Pages
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2021-06-21 22:46:38 +01:00
|
|
|
publish_dir: ./www/dist
|