Skip to content

Merge pull request #1830 from scpwiki/dependabot/cargo/deepwell/log-0… #1915

Merge pull request #1830 from scpwiki/dependabot/cargo/deepwell/log-0…

Merge pull request #1830 from scpwiki/dependabot/cargo/deepwell/log-0… #1915

Workflow file for this run

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: -A unused -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: -A unused -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/wasm-pack-action@v0.3.0
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: -A unused -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/install@v0.1
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: -A unused -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