tree-sitter/.github/workflows/ci.yml
2021-01-11 15:02:50 -08:00

73 lines
1.5 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- "**"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
name: Unix tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest]
toolchain: [stable]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Cache artifacts
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
emsdk-cache-${{ runner.os }}
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
- name: Install emscripten
uses: mymindstorm/setup-emsdk@v7
with:
version: 2.0.11
actions-cache-folder: emsdk-cache-${{ runner.os }}
- name: Build C library
run: make
- name: Build wasm library
run: script/build-wasm
- name: Build CLI
run: cargo build --release
- name: Set up fixture parsers
run: |
script/fetch-fixtures
script/generate-fixtures
script/generate-fixtures-wasm
- name: Run main tests
run: script/test
- name: Run wasm tests
run: script/test-wasm
- name: Run benchmarks
run: script/benchmark