⬆️ Update 👷 GitHub Action actions/checkout to 0ad4b8f #722
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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@d8048d4fdff0633123678b093726e6d7c8ad6de5 # 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@d8048d4fdff0633123678b093726e6d7c8ad6de5 # 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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | |
- name: Authenticate GitHub CLI | |
run: echo ${{github.token}} | gh auth login --with-token | |
- name: Setup Rust Toolchain | |
uses: moonrepo/setup-rust@d8048d4fdff0633123678b093726e6d7c8ad6de5 # 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 |