ci: Migrate Gitlab tests to GitHub runner #2
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: Cargo Clippy | |
on: | |
pull_request: | |
jobs: | |
get-head-commit-msg: | |
runs-on: ubuntu-latest | |
outputs: | |
head-commit-msg: ${{ steps.step-head-commit.outputs.headCommitMsg }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Get Head Commit Message | |
id: step-head-commit | |
run: echo "headCommitMsg=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT" | |
check-clippy: | |
runs-on: ubuntu-latest | |
needs: get-head-commit-msg | |
if: ${{ !contains(needs.get-head-commit-msg.outputs.head-commit-msg, 'ci-skip-rust') }} | |
steps: | |
- name: Free Disk Space | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Cargo Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
key: $ ${{ github.job }}-${{ github.ref_name }}-rustdoc-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
$ ${{ github.job }}-${{ github.ref_name }}-rustdoc- | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Run doc | |
run: | | |
docker run --rm \ | |
-v "${GITHUB_WORKSPACE}:/workspace" \ | |
-v "${HOME}/.cargo:/root/.cargo" \ | |
-w /workspace \ | |
-e RUSTDOCFLAGS='-D warnings' \ | |
-e SKIP_WASM_BUILD=1 \ | |
paritytech/ci-unified:bullseye-1.74.0 \ | |
bash -c " | |
cargo doc --all-features --no-deps --locked" |