Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,33 @@ jobs:
- id: set_image
run: echo "CI_IMAGE=${{ env.CI_IMAGE }}" >> $GITHUB_OUTPUT

check-fmt:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [set-image]
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
- uses: actions/checkout@v4

- name: Cargo fmt
run: |
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
cargo +nightly fmt --all -- --check

- name: Check TOML format
run: |
cargo install taplo-cli
if ! taplo format --check --config .config/taplo.toml; then
echo "Please run 'taplo format --config .config/taplo.toml' to fix any TOML formatting issues"
exit 1
fi

check:
name: Cargo check
# TODO: replace `parity-default` with `ubuntu-latest` when the repo becomes public.
runs-on: parity-default
needs: [set-image]
needs: [set-image, check-fmt]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raymondkfcheung I am just thinking, is it necessary to fail-fast? I think github has features for this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, then we won't wait resources, right?

container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
Expand All @@ -57,7 +79,7 @@ jobs:
name: Cargo check (benchmarking)
# TODO: replace `parity-default` with `ubuntu-latest` when the repo becomes public.
runs-on: parity-default
needs: [set-image]
needs: [set-image, check]
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
steps:
Expand All @@ -78,7 +100,7 @@ jobs:
name: Cargo clippy
# TODO: replace `parity-default` with `ubuntu-latest` when the repo becomes public.
runs-on: parity-default
needs: [set-image]
needs: [set-image, check]
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
env:
Expand All @@ -104,7 +126,7 @@ jobs:
# TODO: replace `parity-default` with `ubuntu-latest` when the repo becomes public.
runs-on: parity-default
timeout-minutes: 60
needs: [set-image]
needs: [set-image, check]
container:
image: ${{ needs.set-image.outputs.CI_IMAGE }}
env:
Expand Down