Skip to content

Commit

Permalink
CI: Update paths for solana-zig scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
joncinque committed Mar 31, 2024
1 parent 06adf0c commit bba1fdd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
44 changes: 34 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ env:
ZIG_SOLANA_DIR: zig-solana

jobs:
program:
name: Build and test helloworld
runs-on: ubuntu-latest
unit-test:
name: Run helloworld unit tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -18,9 +22,6 @@ jobs:
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/zig
$ZIG_SOLANA_DIR
key: zig-solana-${{ hashFiles('./program-test/Cargo.lock') }}-$ZIG_SOLANA_VERSION

Expand All @@ -36,17 +37,40 @@ jobs:
$ZIG build test --summary all --verbose && break || sleep 1
done
integration-test:
name: Run helloworld integration tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/zig
$ZIG_SOLANA_DIR
key: zig-solana-${{ hashFiles('./program-test/Cargo.lock') }}-$ZIG_SOLANA_VERSION

- name: Download zig-solana compiler
shell: bash
run: ZIG_SOLANA_VERSION=v1.39 ./sol/install-zig-solana.sh $ZIG_SOLANA_DIR

- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.76.0

- name: Install build deps
shell: bash
run: |
sudo apt update
sudo apt install protobuf-compiler -y
run: ./sol/program-test/install-build-deps.sh

- name: Build and test program
shell: bash
run: ./program-test/test.sh $ZIG_SOLANA_DIR/zig
run: ./program-test/test.sh
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
zig-solana/
zig-cache/
zig-global-cache/
zig-out/
2 changes: 1 addition & 1 deletion program-test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ZIG="$1"
ROOT_DIR="$(cd "$(dirname "$0")"/..; pwd)"
if [[ -z "$ZIG" ]]; then
ZIG="$ROOT_DIR/../zig-x86_64-linux-gnu-baseline/zig"
ZIG="$ROOT_DIR/zig-solana/zig"
fi
set -e
for i in $(seq 1 5)
Expand Down

0 comments on commit bba1fdd

Please sign in to comment.