From 7b0b9f100cabfddd2bb7a8ad8cafdb82b5b51f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Sp=C3=B6ttel?= <1682504+fspoettel@users.noreply.github.com> Date: Mon, 17 Oct 2022 12:19:11 +0200 Subject: [PATCH] ci: add optional clippy job --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++---------------- README.md | 4 ++++ 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 151b0d3..dadca12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,22 +1,30 @@ -name: CI +name: Continuous Integration -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] +on: push env: - CARGO_TERM_COLOR: always + CARGO_TERM_COLOR: always jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + check: + runs-on: ubuntu-latest + name: Check + steps: + - uses: actions/checkout@v2 + - name: cargo check + run: cargo check + test: + runs-on: ubuntu-latest + name: Test + steps: + - uses: actions/checkout@v2 + - name: cargo test + run: cargo test + # uncomment to enable clippy lints + # clippy: + # runs-on: ubuntu-latest + # name: Lint (clippy) + # steps: + # - uses: actions/checkout@v2 + # - name: cargo clippy + # run: cargo clippy -- -D warnings diff --git a/README.md b/README.md index de41911..1533d2b 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,10 @@ Go to the _Secrets_ tab in your repository settings and create the following sec > **Note** > The session cookie might expire after a while (~1 month) which causes the automated workflow to fail. To fix this issue, refresh the `AOC_SESSION` secret. +### CI: enable clippy lints + +Uncomment the `clippy` job in the `ci.yml` workflow to enable clippy checks in CI. + ## Useful crates - [itertools](https://crates.io/crates/itertools): Extends iterators with extra methods and adaptors. Frequently useful for aoc puzzles.