⬆️ Update 👷 GitHub Action actions/checkout to 9bb5618 #662
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: Pull Request | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
paths-ignore: | |
- LICENSE.md | |
- .gitignore | |
- Justfile | |
jobs: | |
format: | |
name: Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4 | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@b8edcc56aab474d90c7cf0bb8beeaf8334c15e9f # v1 | |
with: | |
components: rustfmt | |
- name: Check Formatting | |
run: cargo fmt -- --check | |
lint: | |
name: Lint Source | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
features: | |
- name: Default | |
args: '' | |
- name: No Standard | |
args: --no-default-features | |
- name: All Features | |
args: --all-features | |
- name: Report | |
args: --features report | |
- name: Unstable | |
args: --features unstable | |
- name: Nightly | |
args: --features nightly | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4 | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@b8edcc56aab474d90c7cf0bb8beeaf8334c15e9f # v1 | |
with: | |
components: clippy | |
- name: Clippy | |
uses: giraffate/clippy-action@13b9d32482f25d29ead141b79e7e04e7900281e0 # v1 | |
test: | |
name: Test Suite | |
runs-on: ${{matrix.os}}-latest | |
needs: [lint, format] | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
toolchain: [stable, beta, nightly] | |
profile: [release, dev] | |
# One day we'll be able to just use `--profile`, but until then we need | |
# to do this workaround to simplify the build steps | |
os: [ubuntu, windows, macos] | |
env: | |
SCCACHE_CACHE_SIZE: 5G | |
steps: | |
- name: Checkout | |
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4 | |
- name: Authenticate GitHub CLI | |
run: echo ${{github.token}} | gh auth login --with-token | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@b8edcc56aab474d90c7cf0bb8beeaf8334c15e9f # v1 | |
with: | |
bins: sccache, cargo-hack | |
channel: ${{matrix.toolchain}} | |
cache-target: ${{matrix.profile}} | |
- name: Setup Shared Cache Directory | |
run: | | |
declare path="${HOME}/.cache/sccache" | |
if test "${RUNNER_OS}" = "Windows"; then | |
path=$(cygpath --windows "${path}") | |
fi | |
echo "SCCACHE_DIR=${path}" >> "${GITHUB_ENV}" | |
- name: Restore sccache build artifacts | |
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4 | |
with: | |
restore-keys: ${{runner.os}}-${{matrix.toolchain}}-${{matrix.profile}}- | |
key: ${{runner.os}}-${{matrix.toolchain}}-${{matrix.profile}}-${{hashFiles('**/Cargo.lock')}} | |
path: ${{env.SCCACHE_DIR}} | |
- name: Run Tests (${{matrix.profile}}) | |
run: cargo hack test --profile ${{matrix.profile}} --feature-powerset | |
env: | |
RUSTC_WRAPPER: sccache |