automerge/.github/workflows/ci.yaml
Andrew Jeffery 3c0c407192
Add initial github actions setup (#237)
Add initial github actions setup
2022-01-10 17:18:18 +00:00

152 lines
3.1 KiB
YAML

on:
push:
branches:
- main
pull_request:
branches:
- main
name: Continuous integration
jobs:
format-doc:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
# - 1.31.0 # MSRV
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Doc
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --all-features
clippy:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: clippy
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
# - 1.31.0 # MSRV
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets --workspace
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
wasm-build-test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
# - 1.31.0 # MSRV
steps:
- uses: actions/checkout@v2
- name: Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Install wasm-pack binary crate
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Test the frontend in wasm
run: wasm-pack test --node automerge-frontend
- name: Use Node.js 12
uses: actions/setup-node@v2
with:
node-version: 12
cache: 'yarn'
cache-dependency-path: automerge-backend-wasm/yarn.lock
- name: Build backend wasm
working-directory: automerge-backend-wasm
run: yarn dev
- name: Test backend wasm
working-directory: automerge-backend-wasm
run: yarn test:js