This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 924
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: divide workflows into reusable pieces
- Loading branch information
1 parent
c732fad
commit 83ad925
Showing
6 changed files
with
138 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
on: | ||
workflow_call: | ||
secrets: inherit | ||
|
||
jobs: | ||
checkout: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
workflow_call: | ||
secrets: inherit | ||
|
||
jobs: | ||
checkout: | ||
uses: ./.github/workflows/checkout.yml@main | ||
|
||
install-dependencies: | ||
needs: checkout | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install package manager | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.6.1 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'pnpm' | ||
|
||
- name: Install dependencies | ||
run: pnpm install |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
pid: | ||
required: true | ||
type: string | ||
secrets: inherit | ||
|
||
jobs: | ||
teardown_validator: | ||
name: Stop Test Validator | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Stop Test Validator | ||
run: kill ${{ inputs.pid }} |