Skip to content

Commit

Permalink
refactor workflow, add light cli build step
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeytimoshin committed Jan 6, 2025
1 parent 5001b99 commit 4567f11
Showing 1 changed file with 23 additions and 85 deletions.
108 changes: 23 additions & 85 deletions .github/workflows/forester-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,16 @@ name: forester-tests

on:
push:
branches:
- main
paths:
branches: [main]
paths: &paths
- "forester/**"
- "forester-utils/**"
- "photon-api/**"
- ".github/workflows/forester-tests.yml"
pull_request:
branches:
- "**"
paths:
- "forester/**"
- "forester-utils/**"
- "photon-api/**"
- ".github/workflows/forester-tests.yml"
types:
- opened
- synchronize
- reopened
- ready_for_review
branches: ["**"]
paths: *paths
types: [opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -31,35 +21,18 @@ env:
RUSTFLAGS: "--cfg tokio_unstable -D warnings"

jobs:
test-address-batched:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Setup and build
uses: ./.github/actions/setup-and-build
- name: Clean build artifacts before tests
shell: bash
run: |
cargo clean
rm -rf target/debug/deps/*
- name: Check available disk space
shell: bash
run: |
df -h /
du -sh /home/runner/work/* | sort -hr | head -n 10
- name: Build test program
run: |
source ./scripts/devenv.sh
cargo test-sbf -p create-address-test-program
- name: Run address batched tests
run: |
source ./scripts/devenv.sh
cargo test --package forester test_address_batched -- --nocapture
test-state-batched:
test:
strategy:
matrix:
test-name: [
{name: "address-batched", command: "test_address_batched", timeout: 60, needs-test-program: true},
{name: "state-batched", command: "test_state_batched", timeout: 60, needs-test-program: false},
{name: "2-foresters", command: "test_epoch_monitor_with_2_foresters", timeout: 60, needs-test-program: false},
{name: "double-registration", command: "test_epoch_double_registration", timeout: 30, needs-test-program: false}
]
name: test-${{ matrix.test-name.name }}
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: ${{ matrix.test-name.timeout }}
steps:
- uses: actions/checkout@v4
- name: Setup and build
Expand All @@ -74,51 +47,16 @@ jobs:
run: |
df -h /
du -sh /home/runner/work/* | sort -hr | head -n 10
- name: Run state batched tests
- name: Build Light CLI
run: |
source ./scripts/devenv.sh
cargo test --package forester test_state_batched -- --nocapture
test-2-foresters:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Setup and build
uses: ./.github/actions/setup-and-build
- name: Clean build artifacts before tests
shell: bash
run: |
cargo clean
rm -rf target/debug/deps/*
- name: Check available disk space
shell: bash
run: |
df -h /
du -sh /home/runner/work/* | sort -hr | head -n 10
- name: Run 2 foresters test
npx nx build @lightprotocol/zk-compression-cli
- name: Build test program
if: ${{ matrix.test-name.needs-test-program }}
run: |
source ./scripts/devenv.sh
cargo test --package forester test_epoch_monitor_with_2_foresters -- --nocapture
test-double-registration:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Setup and build
uses: ./.github/actions/setup-and-build
- name: Clean build artifacts before tests
shell: bash
run: |
cargo clean
rm -rf target/debug/deps/*
- name: Check available disk space
shell: bash
run: |
df -h /
du -sh /home/runner/work/* | sort -hr | head -n 10
- name: Run epoch double registration test
cargo test-sbf -p create-address-test-program
- name: Run ${{ matrix.test-name.name }} tests
run: |
source ./scripts/devenv.sh
cargo test --package forester test_epoch_double_registration -- --nocapture
cargo test --package forester ${{ matrix.test-name.command }} -- --nocapture

0 comments on commit 4567f11

Please sign in to comment.