Skip to content

Commit

Permalink
Merge pull request #184 from firedancer-io/self-hosted
Browse files Browse the repository at this point in the history
self hosted runner
  • Loading branch information
kbhargava-jump authored Dec 12, 2024
2 parents a17d227 + c10d7b8 commit 79d8cd8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 29 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
test:
name: cargo check + test
runs-on: ubuntu-latest
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/[email protected]
Expand All @@ -22,8 +22,8 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get install protobuf-compiler
sudo apt-get install libudev-dev
sudo dnf install protobuf-compiler
sudo dnf install systemd-devel
- name: Clone protosol
run: make fetch_proto
Expand All @@ -35,25 +35,12 @@ jobs:
cargo fmt --all -- --check
cargo clippy --all -- -D warnings
- name: Test
run: |
cargo check --release
cargo test --release
cargo clean
- name: Run binaries build
run: make -j binaries
run: make -j test binaries shared_obj

- name: Run test-vectors
run: |
./scripts/run_test_vectors.sh
rm -rf dump/
- name: Clean up binaries
run: make clean

- name: Run shared obj build
run: make -j shared_obj
- uses: actions/upload-artifact@v4
if: ${{ inputs.upload_artifacts }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,9 @@ binaries:
tests/self_test: tests/self_test.c
$(CC) -o $@ $< -Werror=all -pedantic -ldl -fsanitize=address,fuzzer-no-link -fsanitize-coverage=inline-8bit-counters

test:
$(CARGO) check --release
$(CARGO) test --release

clean:
$(CARGO) clean
$(CARGO) clean
27 changes: 16 additions & 11 deletions scripts/run_test_vectors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ else
cd ../..
fi

find dump/test-vectors/instr/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_instr {} + > $LOG_PATH/test_exec_instr.log 2>&1
# secp256r1 currently not working, agave has bugs
# find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1
find dump/test-vectors/txn/fixtures/precompile/ed25519 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1
find dump/test-vectors/txn/fixtures/precompile/secp256k1 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1
find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_txn.log 2>&1
find dump/test-vectors/cpi/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_cpi {} + > $LOG_PATH/test_exec_cpi.log 2>&1
find dump/test-vectors/syscall/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_vm_syscall {} + > $LOG_PATH/test_exec_vm_syscall.log 2>&1
find dump/test-vectors/vm_interp/fixtures/latest -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp.log 2>&1
find dump/test-vectors/vm_interp/fixtures/v0 -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp.log 2>&1
find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_elf_loader {} + > $LOG_PATH/test_exec_elf_loader.log 2>&1
parallel_commands() {
echo "find dump/test-vectors/instr/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_instr {} + > $LOG_PATH/test_exec_instr.log 2>&1"
# secp256r1 currently not working, agave has bugs
# echo "find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile.log 2>&1"
echo "find dump/test-vectors/txn/fixtures/precompile/ed25519 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile_ed25519.log 2>&1"
echo "find dump/test-vectors/txn/fixtures/precompile/secp256k1 -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_precompile_secp256k1.log 2>&1"
echo "find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' -exec ./target/release/test_exec_txn {} + > $LOG_PATH/test_exec_txn.log 2>&1"
echo "find dump/test-vectors/cpi/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_cpi {} + > $LOG_PATH/test_exec_cpi.log 2>&1"
echo "find dump/test-vectors/syscall/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_vm_syscall {} + > $LOG_PATH/test_exec_vm_syscall.log 2>&1"
echo "find dump/test-vectors/vm_interp/fixtures/latest -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp_latest.log 2>&1"
echo "find dump/test-vectors/vm_interp/fixtures/v0 -type f -name '*.fix' -exec ./target/release/test_exec_vm_interp {} + > $LOG_PATH/test_exec_vm_interp_v0.log 2>&1"
echo "find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' -exec ./target/release/test_exec_elf_loader {} + > $LOG_PATH/test_exec_elf_loader.log 2>&1"
}

# Run the commands in parallel
parallel_commands | xargs -I CMD -P 4 bash -c CMD

failed=`grep -wR FAIL $LOG_PATH | wc -l`
passed=`grep -wR OK $LOG_PATH | wc -l`
Expand Down

0 comments on commit 79d8cd8

Please sign in to comment.