Remove nightly from Rust lint checks #1775
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: '[ftml] Rust' | |
on: | |
pull_request: | |
paths: | |
- 'ftml/Cargo.toml' | |
- 'ftml/Cargo.lock' | |
- 'ftml/conf/*.toml' | |
- 'ftml/src/**' | |
- 'ftml/test/*' | |
- '.github/workflows/ftml.yaml' | |
- '.github/codecov.yml' | |
push: | |
branches: | |
- develop | |
- prod | |
jobs: | |
library_build_and_test: | |
name: Library | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Cargo Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
ftml/target | |
key: ${{ runner.os }}-ftml-default-${{ hashFiles('ftml/**/Cargo.toml') }} | |
- name: Build (All Features) | |
run: cd ftml && cargo build --all-features | |
- name: Build (No Features) | |
run: cd ftml && cargo build --no-default-features | |
- name: Test | |
run: cd ftml && cargo test --all-features -- --nocapture --test-threads 1 | |
- name: Test (exhaustive) | |
run: cd deepwell && cargo test --all-features -- --nocapture --ignored | |
if: github.ref == 'refs/head/develop' || github.ref == 'refs/head/prod' | |
wasm: | |
name: WebASM | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: WASM Toolchain | |
uses: jetli/[email protected] | |
with: | |
version: latest | |
- name: Cargo Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
ftml/target | |
key: ${{ runner.os }}-ftml-webasm-${{ hashFiles('ftml/**/Cargo.toml') }} | |
- name: Build (Default) | |
run: cd ftml && wasm-pack build --dev | |
- name: Build (No Features) | |
run: cd ftml && wasm-pack build --dev -- --no-default-features | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Cargo Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
ftml/target | |
key: ${{ runner.os }}-ftml-coverage-${{ hashFiles('ftml/**/Cargo.toml') }} | |
- name: Install Tarpaulin | |
uses: actions-rs/[email protected] | |
with: | |
crate: cargo-tarpaulin | |
version: latest | |
use-tool-cache: true | |
- name: Generate Coverage | |
run: cd ftml && cargo tarpaulin | |
- name: Export Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
directory: ftml/target/coverage | |
flags: ftml | |
clippy_lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Rust Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Cargo Cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
ftml/target | |
key: ${{ runner.os }}-ftml-lint-${{ hashFiles('ftml/**/Cargo.toml') }} | |
- name: Rustfmt | |
run: cd ftml && cargo fmt --all -- --check | |
- name: Clippy | |
run: cd ftml && cargo clippy --no-deps -- -A unused_imports | |
# See deepwell.yaml for explainer on unused_imports. |