enso/gui/.github/workflows/build.yml
Adam Obuchowicz a07ad85444 Add wasm-pack test to github workflows (https://github.com/enso-org/ide/pull/49)
To the test workflow added a step where wasm-pack test is run for each crate in workspace.

A script was added, which runs wasm-pack test for each workspace members, because The wasm-pack itself cannot read workspaces. The script was written in rust, therefore a special crate for build-and-utility-scripts in rust was created.


Original commit: 51d3eaec7e
2019-11-25 11:52:51 +01:00

118 lines
3.2 KiB
YAML

name: Build (MacOS, Linux, Windows)
on: [push]
# 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
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest, 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: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2019-11-04
override: true
- uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '78.0.3904.105'
- name: Install wasm-pack
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-pack
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run wasm-pack tests
uses: actions-rs/cargo@v1
with:
command: run
args: >
--manifest-path=script/rust/Cargo.toml
--bin test-all
-- --node --chrome --headless
# TODO[AO] formatter does not work
# fmt:
# name: Formatter
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: nightly-2019-11-04
# override: true
# - run: rustup component add rustfmt
# - uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --all -- --check
clippy:
name: Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2019-11-04
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
coverage:
name: Coverage
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: 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
id: coverage
uses: actions-rs/grcov@v0.1
- name: list all /tmp files
run: ls -la /tmp
- name: show the coverage report
run: cat ${{ steps.coverage.outputs.report }}
- name: Upload coverage report
uses: codecov/codecov-action@v1.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./lcov.info