texlab/.github/workflows/ci.yml
2022-04-28 21:40:03 +02:00

91 lines
2.6 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- master
- develop
- feature/*
env:
CARGO_INCREMENTAL: 0
CI: 1
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Collect
uses: actions-rs/tarpaulin@v0.1
with:
args: "--avoid-cfg-tarpaulin"
- name: Upload
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
server:
name: LSP Server
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
toolchain: stable
transpile_target: null
- os: ubuntu-18.04
toolchain: 1.58.1
transpile_target: null
- os: windows-latest
toolchain: stable
transpile_target: null
- os: macos-latest
toolchain: stable
transpile_target: null
- os: macos-latest
toolchain: stable
transpile_target: aarch64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain for a native compiler
uses: actions-rs/toolchain@v1
id: rust_toolchain_native
if: matrix.transpile_target == null
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt
- name: Install Rust toolchain for a cross compiler
uses: actions-rs/toolchain@v1
if: steps.rust_toolchain_native.conclusion == 'skipped'
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt
target: ${{ matrix.transpile_target }}
- name: Cache dependencies
uses: Swatinem/rust-cache@v1
- name: Compile with a native compiler
id: rust_compile_native
if: matrix.transpile_target == null
run: cargo test --no-run --locked
- name: Compile with a cross compiler
if: steps.rust_compile_native.conclusion == 'skipped'
run: cargo test --target ${{ matrix.transpile_target }} --no-run --locked
- name: Test with a native compiler
id: rust_test_native
if: matrix.transpile_target == null
run: cargo test -- --nocapture --quiet