Skip to content

⬆️ Update 👷 GitHub Action baptiste0928/cargo-install to 9f6037e #694

⬆️ Update 👷 GitHub Action baptiste0928/cargo-install to 9f6037e

⬆️ Update 👷 GitHub Action baptiste0928/cargo-install to 9f6037e #694

Workflow file for this run

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@b4ffde65f46336ab88eb53be808477a3936bae11 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # 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@b4ffde65f46336ab88eb53be808477a3936bae11 # 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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # 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