-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): test start-stop aws instance
- Loading branch information
Showing
9 changed files
with
206 additions
and
49 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,19 @@ | ||
# This simple workflow is used to test if a runner is registered on GitHub platform. | ||
name: Test registered runner | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner-name: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-runner: | ||
name: Test Runner | ||
runs-on: ${{ inputs.runner-name }} | ||
timeout-minutes: 5 # Job should be picked very quickly | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 |
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,22 @@ | ||
# This simple workflow is used to test if a runner is removed from GitHub platform. | ||
name: Test registered runner | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner-name: | ||
required: true | ||
type: string | ||
exist-ok: | ||
type: boolean | ||
default: false | ||
|
||
jobs: | ||
test-removed-runner: | ||
name: Test Removed Runner | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check removal | ||
id: checkout | ||
run: | | ||
echo "1" |
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,44 @@ | ||
name: Test Javascript | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-javascript: | ||
name: JavaScript Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | ||
|
||
- name: Setup Node.js | ||
id: setup-node | ||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af | ||
with: | ||
node-version-file: .node-version | ||
cache: npm | ||
|
||
- name: Install Dependencies | ||
id: npm-ci | ||
run: npm ci | ||
|
||
- name: Check Format | ||
id: npm-format-check | ||
run: npm run format:check | ||
|
||
- name: Lint | ||
id: npm-lint | ||
run: npm run lint | ||
|
||
- name: Test | ||
id: npm-ci-test | ||
run: npm run ci-test |
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,83 @@ | ||
# Test action to spawn/terminate backend instance | ||
name: Test Spawn-Terminate | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
action-start: | ||
name: GitHub Actions Test (spawn) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
provider: [ aws, hyperstack ] | ||
fail-fast: false | ||
outputs: | ||
runner-aws: ${{ steps.gen-output.outputs.runner_aws }} | ||
runner-hyperstack: ${{ steps.gen-output.outputs.runner_hyperstack }} | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | ||
|
||
- name: Test start instance | ||
id: test-start | ||
uses: ./ | ||
with: | ||
mode: start | ||
github-token: ${{ secrets.SLAB_ACTION_TOKEN }} | ||
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }} | ||
job-secret: ${{ secrets.JOB_SECRET }} | ||
backend: ${{ matrix.provider }} | ||
profile: ci-test | ||
|
||
- name: Generate output | ||
id: gen-output | ||
run: | | ||
echo "runner_${{ matrix.provider }}=${{ steps.test-start.outputs.label }}" >> "$GITHUB_OUTPUT" | ||
test-runner-alive-aws: | ||
name: Test runner is alive (AWS) | ||
needs: [ action-start ] | ||
uses: ./.github/workflows/registered_runner.yml | ||
with: | ||
runner-name: ${{ needs.action-start.outputs.runner-aws }} | ||
|
||
test-runner-alive-hyperstack: | ||
name: Test runner is alive (Hyperstack) | ||
needs: [ action-start ] | ||
uses: ./.github/workflows/registered_runner.yml | ||
with: | ||
runner-name: ${{ needs.action-start.outputs.runner-hyperstack }} | ||
|
||
action-stop: | ||
name: GitHub Actions Test (terminate) | ||
runs-on: ubuntu-latest | ||
needs: [ action-start, test-runner-alive-aws, test-runner-alive-hyperstack ] | ||
if: ${{ always() && needs.action-start.result != 'skipped' }} | ||
strategy: | ||
matrix: | ||
runner: [ "${{ needs.action-start.outputs.runner-aws }}", | ||
"${{ needs.action-start.outputs.runner-hyperstack }}" ] | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 | ||
|
||
- name: Test stop instance | ||
id: test-stop | ||
uses: ./ | ||
with: | ||
mode: stop | ||
github-token: ${{ secrets.SLAB_ACTION_TOKEN }} | ||
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }} | ||
job-secret: ${{ secrets.JOB_SECRET }} | ||
label: ${{ matrix.runner }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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