Skip to content

Merge pull request #395 from moka-rs/ci-skip-dup-actions/v0.10.x #983

Merge pull request #395 from moka-rs/ci-skip-dup-actions/v0.10.x

Merge pull request #395 from moka-rs/ci-skip-dup-actions/v0.10.x #983

Workflow file for this run

name: Clippy lints and Rustfmt
on:
push:
paths-ignore:
- '.devcontainer/**'
- '.gitpod.yml'
- '.vscode/**'
schedule:
# Run against the last commit on the default branch on Friday at 7pm (UTC?)
- cron: '0 19 * * 5'
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
# https://github.com/marketplace/actions/skip-duplicate-actions
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
test:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- toolchain: stable
- toolchain: beta
rustflags: '--cfg beta_clippy'
steps:
- name: Checkout Moka
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust.toolchain }}
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: cargo clean
uses: actions-rs/cargo@v1
with:
command: clean
- name: Run Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Specify individual features until we remove `dash` feature.
# args: --lib --tests --all-features --all-targets -- -D warnings
args: --lib --tests --features 'future, logging, unstable-debug-counters' --all-targets -- -D warnings
env:
RUSTFLAGS: ${{ matrix.rust.rustflags }}
- name: Run Rustfmt
uses: actions-rs/cargo@v1
if: ${{ matrix.rust.toolchain == 'stable' }}
with:
command: fmt
args: --all -- --check