Skip to content

Commit ae04ec1

Browse files
chore(ci): enter venv in CI
Signed-off-by: Dori Medini <[email protected]>
1 parent 8cb5b46 commit ae04ec1

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ jobs:
6262
- name: Setup Python venv
6363
run: |
6464
python3 -m venv ci
65-
ci/bin/pip install -r scripts/requirements.txt
65+
. ci/bin/activate
66+
pip install -r scripts/requirements.txt
6667
6768
# Check Cargo.lock is up to date.
6869
- name: "Check Cargo.lock"
@@ -77,13 +78,13 @@ jobs:
7778
# Run code style on PR.
7879
- name: "Run TODO style pull request"
7980
if: github.event_name == 'pull_request'
80-
run: ci/bin/python scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
81+
run: scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }}
8182
- name: "Run clippy pull request"
8283
if: github.event_name == 'pull_request'
83-
run: ci/bin/python scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
84+
run: scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8485
- name: "Run cargo doc pull request"
8586
if: github.event_name == 'pull_request'
86-
run: ci/bin/python scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
87+
run: scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
8788

8889
# Run code style on push.
8990
- name: "Run rustfmt"
@@ -93,10 +94,10 @@ jobs:
9394

9495
- name: "Run clippy on push"
9596
if: github.event_name == 'push'
96-
run: ci/bin/python scripts/run_tests.py --command clippy
97+
run: scripts/run_tests.py --command clippy
9798
- name: "Run cargo doc on push"
9899
if: github.event_name == 'push'
99-
run: ci/bin/python scripts/run_tests.py --command doc
100+
run: scripts/run_tests.py --command doc
100101

101102
- name: "Run taplo"
102103
run: scripts/taplo.sh
@@ -140,8 +141,9 @@ jobs:
140141
if: github.event_name == 'pull_request'
141142
run: |
142143
python3 -m venv ci
143-
ci/bin/pip install -r scripts/requirements.txt
144-
ci/bin/python scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
144+
. ci/bin/activate
145+
pip install -r scripts/requirements.txt
146+
scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
145147
env:
146148
SEED: 0
147149

@@ -150,10 +152,11 @@ jobs:
150152
# TODO(Tsabary): Find a better way to set the ephemeral port range.
151153
run: |
152154
python3 -m venv ci
153-
ci/bin/pip install -r scripts/requirements.txt
155+
. ci/bin/activate
156+
pip install -r scripts/requirements.txt
154157
echo "net.ipv4.ip_local_port_range = 40000 40200" | sudo tee /etc/sysctl.conf
155158
sudo sysctl -p
156-
ci/bin/python scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
159+
scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }}
157160
env:
158161
SEED: 0
159162

@@ -162,8 +165,9 @@ jobs:
162165
# TODO(AdiY/Dori): Better support for running tests on push.
163166
run: |
164167
python3 -m venv ci
165-
ci/bin/pip install -r scripts/requirements.txt
166-
ci/bin/python scripts/run_tests.py --command test
168+
. ci/bin/activate
169+
pip install -r scripts/requirements.txt
170+
scripts/run_tests.py --command test
167171
env:
168172
SEED: 0
169173

.github/workflows/main_nightly.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ jobs:
5353
- name: Setup Python venv
5454
run: |
5555
python3 -m venv ci
56-
ci/bin/pip install -r scripts/requirements.txt
56+
. ci/bin/activate
57+
pip install -r scripts/requirements.txt
5758
5859
# Run feature combo test.
5960
- name: "Run feature combo on all crates."
60-
run: ci/bin/python scripts/run_feature_combos_test.py
61+
run: scripts/run_feature_combos_test.py

.github/workflows/merge_queue_ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
- name: Setup Python venv
3737
run: |
3838
python3 -m venv ci
39-
ci/bin/pip install -r scripts/requirements.txt
39+
. ci/bin/activate
40+
pip install -r scripts/requirements.txt
41+
install -r scripts/requirements.txt
4042
4143
# Check Cargo.lock is up to date.
4244
- name: "Check Cargo.lock"
@@ -45,7 +47,7 @@ jobs:
4547
git diff --exit-code Cargo.lock
4648
4749
- name: "Run clippy on merge queue"
48-
run: ci/bin/python scripts/run_tests.py --command clippy
50+
run: scripts/run_tests.py --command clippy
4951

5052
- name: "Run rustfmt on merge queue"
5153
# The nightly here is coupled with the one in install_rust/action.yml.

scripts/named_todos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/env python3
2+
13
import os
24
import re
35

scripts/run_tests.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ def build_cmds(with_feature: bool) -> List[List[str]]:
8080

8181
# Only run cairo_native feature if the blockifier crate is modified.
8282
if CAIRO_NATIVE_CRATE_TRIGGERS.isdisjoint(crates):
83-
return (cmds_no_feat)
83+
return cmds_no_feat
8484

8585
print(f"Composing sequencer integration test commands with cairo_native feature.")
8686
cmds_with_feat = build_cmds(with_feature=True) + run_cmds
87-
return (cmds_no_feat + cmds_with_feat)
87+
return cmds_no_feat + cmds_with_feat
8888

8989
raise NotImplementedError(f"Command {self} not implemented.")
9090

@@ -111,7 +111,10 @@ def test_crates(crates: Set[str], base_command: BaseCommand):
111111

112112

113113
def run_test(
114-
changes_only: bool, commit_id: Optional[str], base_command: BaseCommand, include_dependencies: bool
114+
changes_only: bool,
115+
commit_id: Optional[str],
116+
base_command: BaseCommand,
117+
include_dependencies: bool,
115118
):
116119
"""
117120
Runs tests.

0 commit comments

Comments
 (0)