-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): make rust version in ci configurable
- Loading branch information
1 parent
ff11dd7
commit 8044734
Showing
11 changed files
with
190 additions
and
26 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,15 @@ on: | |
- edited | ||
|
||
jobs: | ||
set_rust_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: version | ||
run: echo "RUST_VERSION=$(cat .github/workflows/rust_version.txt)" >> $GITHUB_OUTPUT | ||
outputs: | ||
rust_version: ${{ steps.version.outputs.RUST_VERSION }} | ||
|
||
commitlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -54,12 +63,14 @@ jobs: | |
- run: scripts/rust_fmt.sh --check | ||
|
||
clippy: | ||
needs: set_rust_version | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: Noelware/[email protected] | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
components: clippy | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
|
@@ -78,26 +89,32 @@ jobs: | |
- run: scripts/clippy.sh | ||
|
||
doc: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
# env: | ||
# RUSTDOCFLAGS: "-D warnings" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
version: ${{env.PROTOC_VERSION}} | ||
- run: cargo doc --workspace -r --document-private-items --no-deps | ||
|
||
run-tests: | ||
needs: set_rust_version | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Fetch the entire history. | ||
fetch-depth: 0 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Noelware/[email protected] | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
|
@@ -134,10 +151,13 @@ jobs: | |
SEED: 0 | ||
|
||
taplo: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: baptiste0928/cargo-install@v3 | ||
with: | ||
|
@@ -154,12 +174,15 @@ jobs: | |
uses: bnjbvr/cargo-machete@main | ||
|
||
check: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
env: | ||
RUSTDOCFLAGS: "-D warnings" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,23 @@ env: | |
PROTOC_VERSION: v25.1 | ||
|
||
jobs: | ||
set_rust_version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: version | ||
run: echo "RUST_VERSION=$(cat .github/workflows/rust_version.txt)" >> $GITHUB_OUTPUT | ||
outputs: | ||
rust_version: ${{ steps.version.outputs.RUST_VERSION }} | ||
|
||
executable-run: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
|
@@ -57,10 +69,13 @@ jobs: | |
& sleep 30 ; kill $! | ||
executable-run-no-rpc: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
|
@@ -76,10 +91,13 @@ jobs: | |
& sleep 30 ; kill $! | ||
integration-test: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
|
@@ -93,10 +111,13 @@ jobs: | |
cargo run -r -p papyrus_node --bin central_source_integration_test --features="futures-util tokio-stream" | ||
test-no-rpc: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
|
||
|
@@ -106,10 +127,13 @@ jobs: | |
SEED: 0 | ||
codecov: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- name: Set-Up | ||
run: | | ||
sudo apt-get update | ||
|
@@ -159,6 +183,7 @@ jobs: | |
cache-to: type=gha,mode=max,scope=buildkit-ci | ||
|
||
random-table-test: | ||
needs: set_rust_version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -173,7 +198,9 @@ jobs: | |
filters: | | ||
target_directory: | ||
- 'crates/papyrus_storage/src/db/**' | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ needs.set_rust_version.outputs.rust_version }} | ||
- uses: Swatinem/rust-cache@v2 | ||
# repeat this job 32 times. this is a random test for part of the code that may cause a corrupted database. | ||
- run: for run in {1..32}; do cargo test -r -p papyrus_storage -- --include-ignored common_prefix_compare_with_simple_table_random; done | ||
|
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
Oops, something went wrong.