summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml24
1 files changed, 13 insertions, 11 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d19c66d7..735db54c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,17 +1,18 @@
-# Main CI workflow to validate PRs.
+# Main CI workflow to validate PRs and branches are correctly formatted
+# and pass tests.
#
-# CI workflow based on:
+# CI workflow was based on a lot of work from other people:
# - https://github.com/heim-rs/heim/blob/master/.github/workflows/ci.yml
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml
# - https://www.reillywood.com/blog/rust-faster-ci/
+# - https://matklad.github.io/2021/09/04/fast-rust-builds.html
#
-# It should run the following:
-# Supported platforms:
+# Supported platforms run the following tasks:
# - cargo fmt
-# - cargo test
-# - cargo clippy after (apparently faster to do so)
+# - cargo test (built/test in separate steps)
+# - cargo clippy (apparently faster to do it after the build/test)
#
-# Unsupported platforms:
+# Unsupported platforms run the following tasks:
# - cargo check
name: ci
@@ -24,6 +25,7 @@ on:
- master
env:
+ RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
@@ -85,10 +87,10 @@ jobs:
target: ${{ matrix.info.target }}
- name: Enable Rust cache
- uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
+ uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # 2.2.0
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with:
- key: ${{ matrix.info.target }}
+ shared-key: build-cache-${{ matrix.info.target }}
- name: Check cargo fmt
run: cargo fmt --all -- --check
@@ -228,10 +230,10 @@ jobs:
target: ${{ matrix.info.target }}
- name: Enable Rust cache
- uses: Swatinem/rust-cache@22c9328bcba27aa81a32b1bef27c7e3c78052531 # 2.0.1
+ uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # 2.2.0
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
with:
- key: ${{ matrix.info.target }}
+ shared-key: build-cache-${{ matrix.info.target }}
- name: Check
uses: ClementTsang/cargo-action@v0.0.3