2019-10-07 15:15:41 +03:00
|
|
|
name: Build (MacOS, Linux, Windows)
|
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
2019-10-07 19:59:19 +03:00
|
|
|
# Please check if all components are available before updating the rust toolchain version.
|
|
|
|
# https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html
|
2019-10-07 19:31:07 +03:00
|
|
|
|
2019-10-07 15:15:41 +03:00
|
|
|
jobs:
|
|
|
|
build:
|
2019-10-07 20:36:42 +03:00
|
|
|
name: Build
|
2019-10-07 15:15:41 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2020-02-06 13:13:07 +03:00
|
|
|
matrix:
|
2019-10-07 15:15:41 +03:00
|
|
|
os: [windows-latest, macOS-latest, ubuntu-latest]
|
|
|
|
steps:
|
2019-10-07 17:19:06 +03:00
|
|
|
- uses: actions/checkout@v1
|
2019-10-07 15:45:49 +03:00
|
|
|
- name: Install Rust Nightly Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-11-18 18:56:26 +03:00
|
|
|
toolchain: nightly-2019-11-04
|
2019-10-07 15:45:49 +03:00
|
|
|
override: true
|
|
|
|
- name: Run cargo check
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
2020-02-06 13:13:07 +03:00
|
|
|
|
2019-10-07 18:01:11 +03:00
|
|
|
test:
|
2019-10-07 20:36:42 +03:00
|
|
|
name: Tests
|
2020-01-30 17:00:58 +03:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest,macOS-latest,ubuntu-latest]
|
2019-10-07 18:01:11 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-11-18 18:56:26 +03:00
|
|
|
toolchain: nightly-2019-11-04
|
2019-10-07 18:01:11 +03:00
|
|
|
override: true
|
2019-11-25 13:52:51 +03:00
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: install
|
|
|
|
args: wasm-pack
|
|
|
|
- name: Run tests
|
|
|
|
uses: actions-rs/cargo@v1
|
2019-10-07 18:01:11 +03:00
|
|
|
with:
|
|
|
|
command: test
|
2020-01-30 17:00:58 +03:00
|
|
|
- name: Install Firefox
|
|
|
|
run: brew cask install firefox
|
|
|
|
if: runner.os == 'macOS'
|
2019-11-25 13:52:51 +03:00
|
|
|
- name: Run wasm-pack tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: run
|
|
|
|
args: >
|
|
|
|
--manifest-path=script/rust/Cargo.toml
|
|
|
|
--bin test-all
|
2020-01-19 04:55:14 +03:00
|
|
|
-- --headless --firefox
|
2019-10-07 18:01:11 +03:00
|
|
|
|
2020-02-06 13:13:07 +03:00
|
|
|
size:
|
|
|
|
name: Check size
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Install Rust Nightly Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: nightly-2019-11-04
|
|
|
|
override: true
|
|
|
|
- name: Install wasm-pack
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: install
|
|
|
|
args: wasm-pack --version 0.8.1
|
|
|
|
- name: Compile to WASM
|
|
|
|
run: ./script/build.sh
|
|
|
|
- name: Minimize WASM
|
|
|
|
run: ./script/minimize_wasm.sh > file_size
|
|
|
|
- name: Check WASM size
|
|
|
|
run: ./script/assert_max_wasm_size.sh
|
2019-10-07 18:01:11 +03:00
|
|
|
|
|
|
|
clippy:
|
2019-10-07 20:36:42 +03:00
|
|
|
name: Linter
|
2019-10-07 18:01:11 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-11-18 18:56:26 +03:00
|
|
|
toolchain: nightly-2019-11-04
|
2019-10-07 18:01:11 +03:00
|
|
|
override: true
|
|
|
|
- run: rustup component add clippy
|
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: -- -D warnings
|
2019-10-07 17:19:06 +03:00
|
|
|
|
|
|
|
coverage:
|
2019-10-07 20:36:42 +03:00
|
|
|
name: Coverage
|
2019-10-07 17:19:06 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Install Rust Nightly Toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-11-18 18:56:26 +03:00
|
|
|
toolchain: nightly-2019-11-04
|
2019-10-07 17:19:06 +03:00
|
|
|
override: true
|
|
|
|
- name: Generate test profile
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --all-features --no-fail-fast
|
|
|
|
env:
|
|
|
|
'CARGO_INCREMENTAL': '0'
|
|
|
|
'RUSTFLAGS': '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads'
|
|
|
|
- name: Generate coverage report
|
2019-10-07 20:03:52 +03:00
|
|
|
id: coverage
|
2019-10-07 17:19:06 +03:00
|
|
|
uses: actions-rs/grcov@v0.1
|
2019-10-07 22:03:03 +03:00
|
|
|
- name: list all /tmp files
|
2019-10-07 21:52:33 +03:00
|
|
|
run: ls -la /tmp
|
2019-10-07 22:03:03 +03:00
|
|
|
- name: show the coverage report
|
|
|
|
run: cat ${{ steps.coverage.outputs.report }}
|
2019-10-07 17:19:06 +03:00
|
|
|
- name: Upload coverage report
|
|
|
|
uses: codecov/codecov-action@v1.0.2
|
|
|
|
with:
|
2019-10-07 23:06:02 +03:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
file: ./lcov.info
|