test(ci): consolidate workflows #1
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
name: Test-PR-CI | |
on: | |
push: | |
env: | |
RUSTFLAGS: "-D warnings -C link-arg=-fuse-ld=lld" | |
jobs: | |
build-and-test: | |
# On PR events, cancel existing CI runs on this same PR for this job. | |
# Also, create different concurrency groups for different pushed commits, on push events. | |
# concurrency: | |
# group: > | |
# ${{ github.workflow }}- | |
# ${{ github.job }}- | |
# ${{ github.ref }}- | |
# ${{ github.event_name == 'pull_request' && 'PR' || github.sha }} | |
# cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
runs-on: starkware-ubuntu-latest-medium | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Fetch the entire history. | |
fetch-depth: 0 | |
- uses: ./.github/actions/bootstrap | |
# Check Cargo.lock is up to date. | |
- name: "Check Cargo.lock" | |
run: | | |
cargo update -w --locked | |
git diff --exit-code Cargo.lock | |
# Setup pypy and link to the location expected by .cargo/config.toml. | |
- uses: actions/setup-python@v5 | |
id: setup-pypy | |
with: | |
python-version: "pypy3.9" | |
- 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 | |
# TODO(Gilad): only one test needs this (base_layer_test.rs), once it migrates to | |
# anvil, remove. | |
- run: npm install -g [email protected] | |
- run: cargo test | |
- run: cargo build | |
# - run: cargo test -p workspace_tests | |
# - run: | | |
# cargo build --bin starknet_sequencer_node --bin sequencer_node_end_to_end_integration_test | |
# # TODO: this may need to run in a different job. Also, if we only cache dependencies (this depends on our caching solution), then I'm not sure it makes sense to build the test in this job (unless upload-artifacts is fast..). | |
# target/debug/sequencer_node_end_to_end_integration_test | |
# - run: > | |
# cargo test | |
# --test latency_histogram | |
# --test gateway_integration_test | |
# --test feeder_gateway_integration_test | |
# -- --include-ignored --skip test_gw_integration_testnet; | |
# cargo run -p papyrus_node --bin central_source_integration_test --features="futures-util tokio-stream" | |
# - name: "Run tests pull request" | |
# # if: github.event_name == 'pull_request' | |
# run: | | |
# python3 -m venv ci | |
# ci/bin/pip install -r scripts/requirements.txt | |
# # TODO: switch back to pr event. | |
# ci/bin/python scripts/run_tests.py --command test --changes_only --include_dependencies --commit_id ${{ github.event.push.before }} | |
# env: | |
# SEED: 0 | |
# # No features - build blockifier without features activated by dependencies in the workspace. | |
# - run: cargo test -p blockifier | |
# - run: cargo build -p blockifier | |
# # transaction_serde is not activated by any workspace crate; test the build. | |
# - run: cargo test -p blockifier --features transaction_serde | |
# - run: cargo build -p blockifier --features transaction_serde | |
# # cairo_native is not activated by any workspace crate; test the build. | |
# - run: cargo test -p blockifier --features cairo_native | |
# - run: cargo build -p blockifier --features cairo_native | |
# - name: "Run clippy pull request" | |
# # if: github.event_name == 'pull_request' | |
# # TODO: switch back to pr event | |
# run: ci/bin/python scripts/run_tests.py --command clippy --changes_only --commit_id ${{ github.event.push.before }} | |
# - name: "Run cargo doc pull request" | |
# # TODO: switch back to pr event | |
# # if: github.event_name == 'pull_request' | |
# run: ci/bin/python scripts/run_tests.py --command doc --changes_only --commit_id ${{ github.event.push.before }} | |
# # Run code style on push. | |
# - name: "Run rustfmt" | |
# # The nightly here is coupled with the one in install_rust/action.yml. | |
# # If we move the install here we can use a const. | |
# run: cargo +"$EXTRA_RUST_TOOLCHAINS" fmt --all -- --check | |
# - run: | | |
# cargo test -p papyrus_node --no-default-features | |
# env: | |
# SEED: 0 | |
# - name: Build node | |
# run: | | |
# mkdir data | |
# cargo build -p papyrus_node | |
# - name: Build node - no rpc | |
# run: | | |
# mkdir data | |
# cargo build -p papyrus_node --no-default-features | |
# - run: cargo test -p committer_cli --release -- --include-ignored test_regression |