chore: Add Github Actions for testing every commit & pull requests
This commit is contained in:
parent
60ca1da468
commit
24ffe94445
|
@ -0,0 +1,77 @@
|
||||||
|
name: Test Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Test rust ${{ matrix.rust_version }} / node ${{ matrix.node_version }} / ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
continue-on-error: ${{ matrix.rust_version == 'nightly' }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
node_version: ['10', '12']
|
||||||
|
rust_version: ['stable', 'beta', 'nightly']
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Use Node.js ${{ matrix.node_version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node_version }}
|
||||||
|
|
||||||
|
- name: Use stable rust toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: ${{ matrix.rust_version }}
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Install linux depencencies
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: sudo apt-get -y install libasound2-dev
|
||||||
|
|
||||||
|
- name: Install wasm-pack
|
||||||
|
run: cargo install wasm-pack
|
||||||
|
|
||||||
|
- name: Run all rust tests
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
|
||||||
|
- name: Check clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: --all --tests -- -D warnings
|
||||||
|
|
||||||
|
- name: Check rust formatting
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
|
- name: Build web self-hosted
|
||||||
|
working-directory: web/selfhosted
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run build -- --mode=production
|
||||||
|
|
||||||
|
- name: Build web demo
|
||||||
|
working-directory: web/demo
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run build -- --mode=production
|
||||||
|
|
||||||
|
- name: Build browser extension
|
||||||
|
working-directory: web/extension
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npm run build -- --mode=production
|
Loading…
Reference in New Issue