diff --git a/.github/workflows/blockifier_compiled_cairo.yml b/.github/workflows/blockifier_compiled_cairo.yml index 0210132d5d7..6d61436d58e 100644 --- a/.github/workflows/blockifier_compiled_cairo.yml +++ b/.github/workflows/blockifier_compiled_cairo.yml @@ -39,10 +39,12 @@ jobs: id: setup-pypy with: python-version: 'pypy3.9' + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt - name: Verify cairo contract recompilation (both cairo versions). run: diff --git a/.github/workflows/blockifier_post-merge.yml b/.github/workflows/blockifier_post-merge.yml index 2ffd188d315..37502042ffb 100644 --- a/.github/workflows/blockifier_post-merge.yml +++ b/.github/workflows/blockifier_post-merge.yml @@ -25,6 +25,7 @@ jobs: id: setup-pypy with: python-version: 'pypy3.9' + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bef3adebaea..cb64b1bdc44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,10 +48,12 @@ jobs: id: setup-pypy with: python-version: "pypy3.9" + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt # Install rust components. - uses: ./.github/actions/bootstrap @@ -59,11 +61,6 @@ jobs: extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }} github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Python venv - run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - # Check Cargo.lock is up to date. - name: "Check Cargo.lock" run: | @@ -77,13 +74,13 @@ jobs: # Run code style on PR. - name: "Run TODO style pull request" if: github.event_name == 'pull_request' - run: ci/bin/python scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }} + run: scripts/named_todos.py --commit_id ${{ github.event.pull_request.base.sha }} - name: "Run clippy pull request" if: github.event_name == 'pull_request' - run: ci/bin/python scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }} + run: scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.pull_request.base.sha }} - name: "Run cargo doc pull request" if: github.event_name == 'pull_request' - run: ci/bin/python scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }} + run: scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.pull_request.base.sha }} # Run code style on push. - name: "Run rustfmt" @@ -93,10 +90,10 @@ jobs: - name: "Run clippy on push" if: github.event_name == 'push' - run: ci/bin/python scripts/run_tests.py --command clippy + run: scripts/run_tests.py --command clippy - name: "Run cargo doc on push" if: github.event_name == 'push' - run: ci/bin/python scripts/run_tests.py --command doc + run: scripts/run_tests.py --command doc - name: "Run taplo" run: scripts/taplo.sh @@ -128,10 +125,13 @@ jobs: id: setup-pypy with: python-version: "pypy3.9" + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt + # TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to # anvil, remove. - run: npm install -g ganache@7.4.3 @@ -139,9 +139,7 @@ jobs: - name: "Run tests pull request" if: github.event_name == 'pull_request' run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - ci/bin/python scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }} + scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }} env: SEED: 0 @@ -149,9 +147,7 @@ jobs: if: github.event_name == 'push' # TODO(AdiY/Dori): Better support for running tests on push. run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - ci/bin/python scripts/run_tests.py --command test + scripts/run_tests.py --command test env: SEED: 0 @@ -171,10 +167,13 @@ jobs: id: setup-pypy with: python-version: "pypy3.9" + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt + # TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to # anvil, remove. - run: npm install -g ganache@7.4.3 @@ -182,8 +181,6 @@ jobs: - name: "Run integration tests pull request" if: github.event_name == 'pull_request' run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - ci/bin/python scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }} + scripts/run_tests.py --command integration --changes_only --include_dependencies --commit_id ${{ github.event.pull_request.base.sha }} env: SEED: 0 diff --git a/.github/workflows/main_nightly.yml b/.github/workflows/main_nightly.yml index 04e11ee537f..c78f2b69561 100644 --- a/.github/workflows/main_nightly.yml +++ b/.github/workflows/main_nightly.yml @@ -40,24 +40,21 @@ jobs: id: setup-pypy with: python-version: "pypy3.9" + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt # Install rust components. - uses: ./.github/actions/bootstrap with: github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Python venv - run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - # Run feature combo test. - name: "Run feature combo on all crates." - run: ci/bin/python scripts/run_feature_combos_test.py + run: scripts/run_feature_combos_test.py run-integration-tests: runs-on: starkware-ubuntu-24.04-large @@ -77,14 +74,13 @@ jobs: - env: LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt # TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to # anvil, remove. - run: npm install -g ganache@7.4.3 - name: "Run integration tests pull request" run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - ci/bin/python scripts/run_tests.py --command integration --is_nightly + scripts/run_tests.py --command integration --is_nightly env: SEED: 0 diff --git a/.github/workflows/merge_paths_ci.yml b/.github/workflows/merge_paths_ci.yml index a5fc183da34..efb485de0f7 100644 --- a/.github/workflows/merge_paths_ci.yml +++ b/.github/workflows/merge_paths_ci.yml @@ -33,6 +33,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.9' + cache: 'pip' - run: | python -m pip install --upgrade pip pip install pytest diff --git a/.github/workflows/merge_queue_ci.yml b/.github/workflows/merge_queue_ci.yml index fd6287d98a0..abc056eea02 100644 --- a/.github/workflows/merge_queue_ci.yml +++ b/.github/workflows/merge_queue_ci.yml @@ -22,10 +22,12 @@ jobs: id: setup-pypy with: python-version: "pypy3.9" + cache: 'pip' - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9 - env: LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV + - run: pip install -r scripts/requirements.txt # Install rust components. - uses: ./.github/actions/bootstrap @@ -33,11 +35,6 @@ jobs: extra_rust_toolchains: ${{ env.EXTRA_RUST_TOOLCHAINS }} github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Setup Python venv - run: | - python3 -m venv ci - ci/bin/pip install -r scripts/requirements.txt - # Check Cargo.lock is up to date. - name: "Check Cargo.lock" run: | @@ -45,7 +42,7 @@ jobs: git diff --exit-code Cargo.lock - name: "Run clippy on merge queue" - run: ci/bin/python scripts/run_tests.py --command clippy + run: scripts/run_tests.py --command clippy - name: "Run rustfmt on merge queue" # The nightly here is coupled with the one in install_rust/action.yml. diff --git a/scripts/named_todos.py b/scripts/named_todos.py index 33e9bb1b9ac..ebc7249af63 100755 --- a/scripts/named_todos.py +++ b/scripts/named_todos.py @@ -1,3 +1,5 @@ +#!/bin/env python3 + import os import re