Replace actions-rs with dtolnay/rust-toolchain #1956
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: CI | |
# Run this workflow every time a new commit is pushed to the repository | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
# Weekly. | |
- cron: "0 0 * * 0" | |
jobs: | |
ensure-conventions: | |
name: Ensure conventions are followed | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Ensure tool names are snake cased | |
run: ./bin/lint_tool_file_names.sh | |
- name: Ensure src/lib.rs files exist | |
run: ./_test/ensure_lib_src_rs_exist.sh | |
- name: Count ignores | |
run: ./_test/count_ignores.sh | |
- name: Check UUIDs | |
run: ./_test/check_uuids.sh | |
- name: Verify exercise difficulties | |
run: ./_test/verify_exercise_difficulties.sh | |
- name: Check exercises for authors | |
run: ./_test/check_exercises_for_authors.sh | |
- name: Ensure relevant files do not have trailing whitespace | |
run: ./bin/lint_trailing_spaces.sh | |
configlet: | |
name: configlet lint | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out default branch locally so that it is available to the scripts. | |
- name: Checkout main | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
ref: main | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Fetch configlet | |
run: ./bin/fetch-configlet | |
- name: Lint configlet | |
run: ./bin/configlet lint | |
markdownlint: | |
name: markdown lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
ref: main | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Run markdown lint | |
run: ./bin/lint_markdown.sh | |
# stolen from https://raw.githubusercontent.com/exercism/github-actions/main/.github/workflows/shellcheck.yml | |
shellcheck: | |
name: shellcheck internal tooling lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Run shellcheck | |
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0 | |
env: | |
SHELLCHECK_OPTS: -x -s bash -e SC2001 --norc | |
compilation: | |
name: Check compilation | |
runs-on: ubuntu-latest | |
strategy: | |
# Allows running the job multiple times with different configurations | |
matrix: | |
rust: ["stable", "beta"] | |
deny_warnings: ['', '1'] | |
steps: | |
# Checks out main locally so that it is available to the scripts. | |
- name: Checkout main | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
ref: main | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e | |
with: | |
toolchain: ${{ matrix.rust }} | |
# run scripts as steps | |
- name: Check exercises | |
env: | |
DENYWARNINGS: ${{ matrix.deny_warnings }} | |
run: ./_test/check_exercises.sh | |
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }} | |
- name: Ensure stubs compile | |
env: | |
DENYWARNINGS: ${{ matrix.deny_warnings }} | |
run: ./_test/ensure_stubs_compile.sh | |
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }} | |
rustformat: | |
name: Check Rust Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e | |
with: | |
toolchain: stable | |
- name: Rust Format Version | |
run: rustfmt --version | |
- name: Format | |
run: bin/format_exercises | |
- name: Diff | |
run: | | |
if ! git diff --color --exit-code; then | |
echo "Please run cargo fmt, or see the diff above:" | |
exit 1 | |
fi | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: ["stable", "beta"] | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
ref: main | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e | |
with: | |
toolchain: ${{ matrix.rust }} | |
# Clippy already installed on Stable, but not Beta. | |
# So, we must install here. | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Clippy tests | |
env: | |
CLIPPY: true | |
run: ./_test/check_exercises.sh | |
- name: Clippy stubs | |
env: | |
CLIPPY: true | |
run: ./_test/ensure_stubs_compile.sh | |
nightly-compilation: | |
name: Check exercises on nightly (benchmark enabled) | |
runs-on: ubuntu-latest | |
continue-on-error: true # It's okay if the nightly job fails | |
steps: | |
# Checks out main locally so that it is available to the scripts. | |
- name: Checkout main | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
ref: main | |
# Checks out a copy of your repository on the ubuntu-latest machine | |
- name: Checkout code | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Setup nightly toolchain | |
uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e | |
with: | |
toolchain: nightly | |
- name: Check exercises | |
env: | |
BENCHMARK: '1' | |
run: ./_test/check_exercises.sh |