chore: divide workflows into reusable pieces #1
Workflow file for this run
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
on: | ||
workflow_call: | ||
outputs: | ||
pid: | ||
description: The PID of the running test validator | ||
value: ${{ jobs.setup-validator.outputs.pid }} | ||
secrets: inherit | ||
jobs: | ||
checkout: | ||
uses: ./.github/workflows/checkout.yml@main | ||
setup-validator: | ||
needs: checkout | ||
name: Install & Start Test Validator | ||
runs-on: ubuntu-latest | ||
outputs: | ||
pid: ${{ steps.test-validator.outputs.TEST_VALIDATOR_PID }} | ||
steps: | ||
- name: Get Test Validator Latest Release | ||
id: get-test-validator-version | ||
run: echo "version=$(./scripts/get-latest-validator-release-version.sh)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- name: Cache Test Validator | ||
id: cache-test-validator | ||
uses: actions/cache@v3 | ||
with: | ||
path: .solana | ||
key: ${{ runner.os }}-test-validator-${{ steps.get-test-validator-version.outputs.version }} | ||
- name: Install Test Validator | ||
if: steps.cache-test-validator.outputs.cache-hit != 'true' | ||
run: scripts/setup-test-validator.sh | ||
- name: Start Test Validator | ||
id: test-validator | ||
run: | | ||
./scripts/start-shared-test-validator.sh & | ||
echo "TEST_VALIDATOR_PID=$!" >> "$GITHUB_OUTPUT" |