Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions .github/actions/setup-test-runner/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Setup test runner
description: Lightweight setup for test jobs that download pre-built artifacts instead of compiling

inputs:
skip-components:
description: 'Comma-separated list of components to skip (e.g., "go,photon"). If not specified, all components are installed.'
required: false
default: ""
build-artifact-name:
description: 'Name of the build artifact to download'
required: false
default: "build-artifacts"

runs:
using: "composite"
steps:
- name: Install system dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libudev-dev pkg-config build-essential protobuf-compiler

- name: Load versions
id: versions
shell: bash
run: |
source scripts/devenv/versions.sh
echo "rust=${RUST_VERSION}" >> $GITHUB_OUTPUT
echo "node=${NODE_VERSION}" >> $GITHUB_OUTPUT
echo "pnpm=${PNPM_VERSION}" >> $GITHUB_OUTPUT
echo "solana=${SOLANA_VERSION}" >> $GITHUB_OUTPUT
echo "anchor=${ANCHOR_VERSION}" >> $GITHUB_OUTPUT
echo "photon=${PHOTON_VERSION}" >> $GITHUB_OUTPUT
echo "photon_commit=${PHOTON_COMMIT}" >> $GITHUB_OUTPUT

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.versions.outputs.rust }}
cache-key: "test-runner"
cache-workspaces: .

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.versions.outputs.node }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ steps.versions.outputs.pnpm }}
run_install: false

- name: Cache Solana CLI
id: cache-solana
uses: actions/cache@v4
with:
path: |
.local/bin/solana*
.local/bin/agave*
.local/bin/cargo-*
.local/bin/platform-tools-sdk
key: ${{ runner.os }}-solana-${{ steps.versions.outputs.solana }}

- name: Install Solana CLI
if: steps.cache-solana.outputs.cache-hit != 'true'
shell: bash
run: bash scripts/devenv/install-solana.sh

- name: Cache Anchor CLI
id: cache-anchor
uses: actions/cache@v4
with:
path: |
.local/cargo/bin/avm
.local/cargo/bin/anchor
key: ${{ runner.os }}-anchor-${{ steps.versions.outputs.anchor }}

- name: Install Anchor CLI
if: steps.cache-anchor.outputs.cache-hit != 'true'
shell: bash
run: bash scripts/devenv/install-anchor.sh

- name: Cache Photon indexer
if: "!contains(inputs.skip-components, 'photon')"
id: cache-photon
uses: actions/cache@v4
with:
path: .local/cargo/bin/photon
key: ${{ runner.os }}-photon-${{ steps.versions.outputs.photon }}-${{ steps.versions.outputs.photon_commit }}

- name: Install Photon indexer
if: "!contains(inputs.skip-components, 'photon') && steps.cache-photon.outputs.cache-hit != 'true'"
shell: bash
run: bash scripts/devenv/install-photon.sh

- name: Install just
uses: extractions/setup-just@v2

- name: Set Light Protocol environment variables
shell: bash
run: |
echo "${PWD}/.local/bin" >> $GITHUB_PATH
echo "${PWD}/.local/cargo/bin" >> $GITHUB_PATH
echo "CARGO_FEATURES=v2_ix" >> $GITHUB_ENV
echo "REDIS_URL=redis://localhost:6379" >> $GITHUB_ENV
echo "SBF_OUT_DIR=target/deploy" >> $GITHUB_ENV

- name: Get pnpm store directory
id: pnpm-store
shell: bash
run: |
STORE_PATH=$(pnpm store path --silent)
echo "STORE_PATH=${STORE_PATH}" >> $GITHUB_ENV
echo "path=${STORE_PATH}" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
id: pnpm-cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
shell: bash
run: |
pnpm install --frozen-lockfile
if [ ! -d "node_modules" ] || [ -z "$(ls -A node_modules 2>/dev/null)" ]; then
echo "Error: node_modules not created after pnpm install"
exit 1
fi

- name: Save pnpm cache
if: steps.pnpm-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}

- name: Generate Solana keypair
shell: bash
run: |
mkdir -p /home/runner/.config/solana/
if [ ! -f /home/runner/.config/solana/id.json ]; then
solana-keygen new --no-bip39-passphrase -o /home/runner/.config/solana/id.json
fi

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.build-artifact-name }}

- name: Extract build artifacts
shell: bash
run: |
tar -xzf build-artifacts.tar.gz
rm build-artifacts.tar.gz
76 changes: 0 additions & 76 deletions .github/workflows/cli-v1.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/cli-v2.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/forester-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ env:
jobs:
test:
name: Forester e2e test
runs-on: warp-ubuntu-latest-x64-4x
runs-on: ubuntu-latest
timeout-minutes: 60

services:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:

compressible-tests:
name: Forester compressible tests
runs-on: warp-ubuntu-latest-x64-4x
runs-on: ubuntu-latest
timeout-minutes: 60

services:
Expand Down
Loading
Loading