Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): make rust version in ci configurable #349

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions .github/actions/install_rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Installs rust toolchain. In order to set/fix the version, edit lines 15 & 22.
inputs:
components:
description: "An optional parameter that will be sent to dtolnay/rust-toolchain."
required: false
type: string

runs:
using: "composite"
steps:
- name: install rust toolchain with given components
if: "${{ inputs.components != '' }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: ${{ inputs.components }}

- name: install rust toolchain without given components
if: "${{ inputs.components == '' }}"
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
4 changes: 2 additions & 2 deletions .github/workflows/blockifier_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand All @@ -40,7 +40,7 @@ jobs:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust

- uses: Swatinem/rust-cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blockifier_compiled_cairo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Noelware/[email protected]
- uses: Swatinem/rust-cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blockifier_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blockifier_post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Noelware/[email protected]
- uses: Swatinem/rust-cache@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/committer_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2

- id: auth
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
runs-on: starkware-ubuntu-20-04-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2

# Commit hash on pull request event would be the head commit of the branch.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: Noelware/[email protected]
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
with:
components: clippy
- uses: Swatinem/rust-cache@v2
Expand All @@ -83,7 +83,7 @@ jobs:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
with:
Expand All @@ -97,7 +97,7 @@ jobs:
with:
# Fetch the entire history.
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Noelware/[email protected]
- uses: Swatinem/rust-cache@v2
with:
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: baptiste0928/cargo-install@v3
with:
Expand All @@ -159,7 +159,7 @@ jobs:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/papyrus_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
with:
Expand All @@ -60,7 +60,7 @@ jobs:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
with:
Expand All @@ -79,7 +79,7 @@ jobs:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]
with:
Expand All @@ -96,7 +96,7 @@ jobs:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- uses: Noelware/[email protected]

Expand All @@ -109,7 +109,7 @@ jobs:
runs-on: starkware-ubuntu-latest-medium
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- name: Set-Up
run: |
sudo apt-get update
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
filters: |
target_directory:
- 'crates/papyrus_storage/src/db/**'
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- 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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/papyrus_nightly-tests-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- run: sudo apt update; sudo apt -y install libclang-dev
# Install libclang-dev that is not a part of the ubuntu vm in github actions.
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/papyrus_nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: github.event.schedule == '30 0 * * *'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2

- run: mkdir data
Expand All @@ -57,7 +57,7 @@ jobs:
if: github.event.schedule == '30 0 * * *'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- run: npm install -g [email protected]

Expand All @@ -73,7 +73,7 @@ jobs:
if: github.event.schedule == '30 0 * * *'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- run: cargo build -r -p papyrus_load_test

Expand All @@ -82,7 +82,7 @@ jobs:
if: github.event.schedule == '30 0 * * *'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- run: >
cargo test -r
Expand All @@ -98,6 +98,6 @@ jobs:
runs-on: starkware-ubuntu-latest-small
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- uses: Swatinem/rust-cache@v2
- run: for run in {1..100}; do cargo test -r -p papyrus_storage -- --include-ignored common_prefix_compare_with_simple_table_random; done
2 changes: 1 addition & 1 deletion .github/workflows/verify-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: ./.github/actions/install_rust
- name: Update Dependencies
run: cargo update --verbose
- name: Build
Expand Down
Loading