-
Notifications
You must be signed in to change notification settings - Fork 25
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 #294
feat(ci): make rust version in ci configurable #294
Conversation
c90febf
to
9ba8c08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find an easy way to set this variable per CI run (i.e for all workflows)..
If this is the right way to do that, we can add it to the other workflows (committer ci for example)
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)
.github/workflows/main.yml
line 58 at r1 (raw file):
with: components: rustfmt toolchain: nightly-2024-04-29
@dorimedini-starkware, do you know why it is fixed to that version? Is that on purpose?
Code quote:
nightly-2024-04-29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @dan-starkware, @nimrod-starkware, and @TzahiTaub)
a discussion (no related file):
- share the env-variable logic between CI jobs
- this env var should select the rust version in all CIs, not just main
a discussion (no related file):
please rebase over main-v0.13.2 (this is a CI fix)
.github/workflows/main.yml
line 18 at r1 (raw file):
- auto_merge_enabled - edited jobs:
newline
Suggestion:
- edited
jobs:
.github/workflows/main.yml
line 24 at r1 (raw file):
- uses: actions/checkout@v4 - id: version run: echo "rust_version=$(cat .github/workflows/rust_version.txt)" >> $GITHUB_OUTPUT
env vars in all caps by convension
Suggestion:
RUST_VERSION
.github/workflows/main.yml
line 58 at r1 (raw file):
Previously, nimrod-starkware wrote…
@dorimedini-starkware, do you know why it is fixed to that version? Is that on purpose?
no. @dan-starkware any idea? not sure this is from papyrus CI, just from your experience maybe you know
9ba8c08
to
1653a0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, 5 unresolved discussions (waiting on @dan-starkware, @dorimedini-starkware, and @TzahiTaub)
.github/workflows/main.yml
line 18 at r1 (raw file):
Previously, dorimedini-starkware wrote…
newline
Done.
.github/workflows/main.yml
line 24 at r1 (raw file):
Previously, dorimedini-starkware wrote…
env vars in all caps by convension
Done.
1653a0f
to
3642e7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, 5 unresolved discussions (waiting on @dan-starkware, @dorimedini-starkware, and @TzahiTaub)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
please rebase over main-v0.13.2 (this is a CI fix)
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dan-starkware, @nimrod-starkware, and @TzahiTaub)
b2f7a04
to
8044734
Compare
Benchmark movements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 9 of 9 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-starkware, @nimrod-starkware, and @TzahiTaub)
.github/workflows/papyrus_nightly-tests-call.yml
line 36 at r4 (raw file):
- uses: dtolnay/rust-toolchain@master with: toolchain: ${{ needs.set_rust_version.outputs.rust_version }}
non-blocking, but if this works - consider it... you have code duplication anyway, maybe cat
ing each time isn't so bad
Suggestion:
jobs:
GW-integration-test-call:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: $(cat .github/workflows/rust_version.txt)
.github/workflows/verify-deps.yml
line 32 at r4 (raw file):
run: cargo build --verbose - name: Test run: cargo test --verbose
looking at this particular job, I believe this one should actually stay stable
.
not sure who wrote it and what the intention was, but it looks like it tests that our code works with latest packages - so makes sense to also test if our code works with latest release of rust, even if the rest of the jobs have fixed rust versions
Code quote:
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 }}
latest_deps:
needs: set_rust_version
name: Latest Dependencies
runs-on: ubuntu-20.04
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ needs.set_rust_version.outputs.rust_version }}
- name: Update Dependencies
run: cargo update --verbose
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
Previously, dorimedini-starkware wrote…
We didn't want it to break between changes. AFAIR we agreed on default to latest with an easy way to change globally if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-starkware, @nimrod-starkware, and @TzahiTaub)
.github/workflows/main.yml
line 58 at r1 (raw file):
Previously, dan-starkware wrote…
We didn't want it to break between changes. AFAIR we agreed on default to latest with an easy way to change globally if needed
@nimrod-starkware try changing this to stable and see if CIs pass? this may cause many format issues; but if it works then I think you can and should replace the toolchain here to the one in your rust_version.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @dan-starkware, @dorimedini-starkware, and @nimrod-starkware)
a discussion (no related file):
What exactly is the desired behavior? Do we want the rust version to be determined per commit across all of the CI? Or do we just want the ability to change it globally (i.e., not
.github/workflows/papyrus_nightly-tests-call.yml
line 36 at r4 (raw file):
Previously, dorimedini-starkware wrote…
non-blocking, but if this works - consider it... you have code duplication anyway, maybe
cat
ing each time isn't so bad
AFAIU this is not possible - you can't run a bash command out of a run
step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-starkware, @dorimedini-starkware, and @nimrod-starkware)
a discussion (no related file):
Previously, dorimedini-starkware wrote…
- share the env-variable logic between CI jobs
- this env var should select the rust version in all CIs, not just main
I'm not sure I understand 2. What exactly do we want? If we want the ability to change the version globally for all branches - we can set an env var via the repo settings and read it in all workflows - this is the better option if we don't want the version to be per commit (the limitation is that only the repo owners can set the version). Can this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dan-starkware and @dorimedini-starkware)
a discussion (no related file):
Previously, TzahiTaub (Tzahi) wrote…
I'm not sure I understand 2. What exactly do we want? If we want the ability to change the version globally for all branches - we can set an env var via the repo settings and read it in all workflows - this is the better option if we don't want the version to be per commit (the limitation is that only the repo owners can set the version). Can this work?
We do want a version per commit. For example, we would like to fix a rust version for release branches
b3ac2a1
to
1513584
Compare
Benchmark movements: |
0183766
to
9dbeb9d
Compare
2263900
to
aaba979
Compare
Benchmark movements: |
Benchmark movements: |
Benchmark movements: |
aaba979
to
3c90578
Compare
Benchmark movements: |
3c90578
to
6c62769
Compare
Benchmark movements: |
0a48a3c
to
bc7a1b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @dan-starkware and @TzahiTaub)
.github/actions/install_rust/action.yml
line 15 at r14 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
A suggestion - define an env var here with the toolchain version - to have a single location to change and to avoid the
edit lines 15 & 22
guidelines - as changing this file can change the line numbers but it's easy to miss updating the comment.
I tried to do that, but I couldn't find an easy way.
Benchmark movements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dan-starkware and @TzahiTaub)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dan-starkware and @TzahiTaub)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dan-starkware and @nimrod-starkware)
.github/actions/install_rust/action.yml
line 15 at r14 (raw file):
Previously, nimrod-starkware wrote…
I tried to do that, but I couldn't find an easy way.
I see, I thought it would be possible to define an env
scope but I see it's not possible for composite actions. You can try to define the toolchain in a step above the current two:
steps:
- name: Define toolchain
run: echo "DEFAULT_TOOLCHAIN=stable" >> $GITHUB_ENV # Will change the env of a caller workflow (overriding this var if it exists)
- name: install ...
...
with:
toolchain: ${{ env.DEFAULT_TOOLCHAIN}}
465d85c
to
88985d3
Compare
88985d3
to
00f29f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 15 of 16 files reviewed, all discussions resolved (waiting on @dan-starkware, @dorimedini-starkware, and @TzahiTaub)
.github/actions/install_rust/action.yml
line 15 at r14 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
I see, I thought it would be possible to define an
env
scope but I see it's not possible for composite actions. You can try to define the toolchain in a step above the current two:steps: - name: Define toolchain run: echo "DEFAULT_TOOLCHAIN=stable" >> $GITHUB_ENV # Will change the env of a caller workflow (overriding this var if it exists) - name: install ... ... with: toolchain: ${{ env.DEFAULT_TOOLCHAIN}}
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r16, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dan-starkware)
Benchmark movements: |
Benchmark movements: |
This change is