Update to rust 1.78 in CI #6656
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
# Syntax reference: | |
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions | |
name: Lint Checks | |
permissions: read-all | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint-python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
# Run on PR head instead of merge result. Running on the merge | |
# result can give confusing results, and we require PR to be up to | |
# date with target branch before merging, anyway. | |
# See https://github.com/shadow/shadow/issues/2166 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- run: pip install flake8 | |
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude src/external | |
lint-shell: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
# Run on PR head instead of merge result. Running on the merge | |
# result can give confusing results, and we require PR to be up to | |
# date with target branch before merging, anyway. | |
# See https://github.com/shadow/shadow/issues/2166 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- run: sudo apt-get install shellcheck | |
- run: find . -name '*.sh' | xargs shellcheck | |
lint-rust: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Run on PR head instead of merge result. Running on the merge | |
# result can give confusing results, and we require PR to be up to | |
# date with target branch before merging, anyway. | |
# See https://github.com/shadow/shadow/issues/2166 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Rust toolchain | |
run: ln -s ci/rust-toolchain-stable.toml rust-toolchain.toml | |
- name: check rust version | |
run: cargo --version | |
- name: Add rustfmt | |
run: rustup component add rustfmt | |
- name: Rustfmt check | |
run: (cd src && cargo fmt -- --check) | |
lint-clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Run on PR head instead of merge result. Running on the merge | |
# result can give confusing results, and we require PR to be up to | |
# date with target branch before merging, anyway. | |
# See https://github.com/shadow/shadow/issues/2166 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Rust toolchain | |
run: ln -s ci/rust-toolchain-stable.toml rust-toolchain.toml | |
- name: check rust version | |
run: cargo --version | |
- name: Add clippy | |
run: rustup component add clippy | |
- name: clippy | |
run: (cd src && cargo clippy -- -Dwarnings) | |
lint-cargo-lock: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cargo update check | |
run: | | |
# This will return an error if any versions of local crates in the Cargo.lock | |
# are out of date compared to the crate versions in Cargo.toml. This can fail | |
# if the Shadow version is bumped without using Cargo to update the lock file. | |
(cd src && cargo update --locked --workspace) | |
lint-cargo-doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Run on PR head instead of merge result. Running on the merge | |
# result can give confusing results, and we require PR to be up to | |
# date with target branch before merging, anyway. | |
# See https://github.com/shadow/shadow/issues/2166 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set Rust toolchain | |
run: ln -s ci/rust-toolchain-stable.toml rust-toolchain.toml | |
- name: check rust version | |
run: cargo --version | |
- name: Add rustdoc | |
run: rustup component add rust-docs | |
- name: Cargo doc check | |
run: (cd src && RUSTDOCFLAGS='-D warnings' cargo doc) |