Skip to content

Commit

Permalink
DEBUG: find registered runner
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Nov 19, 2024
1 parent 3ce2af8 commit c36e7c0
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 67 deletions.
130 changes: 65 additions & 65 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,71 +11,71 @@ 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

test-action-spawn-terminate:
name: GitHub Actions Test (spawn -> terminate)
runs-on: ubuntu-latest
strategy:
matrix:
provider: [ aws, hyperstack ]
fail-fast: false
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: Test stop instance
id: test-stop
if: ${{ always() }}
uses: ./
with:
mode: stop
github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }}
job-secret: ${{ secrets.JOB_SECRET }}
label: ${{ steps.test-start.outputs.label }}
# 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
#
# test-action-spawn-terminate:
# name: GitHub Actions Test (spawn -> terminate)
# runs-on: ubuntu-latest
# strategy:
# matrix:
# provider: [ aws, hyperstack ]
# fail-fast: false
# 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: Test stop instance
# id: test-stop
# if: ${{ always() }}
# uses: ./
# with:
# mode: stop
# github-token: ${{ secrets.SLAB_ACTION_TOKEN }}
# slab-url: ${{ secrets.SLAB_BASE_URL_PRE_PROD }}
# job-secret: ${{ secrets.JOB_SECRET }}
# label: ${{ steps.test-start.outputs.label }}

test-action-start-stop:
name: GitHub Actions Test (start -> stop)
Expand Down
6 changes: 5 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/gh.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ async function getRunner(label) {
repo: config.githubContext.repo
}
)
const foundRunners = _.filter(runners, { labels: [{ name: label }] })
core.info(`runners collected: ${JSON.stringify(runners)}`)
const foundRunners = _.filter(runners, { name: label })
core.info(`runners FOUND: ${JSON.stringify(foundRunners)}`)
return foundRunners.length > 0 ? foundRunners[0] : null
} catch (error) {
return null
Expand All @@ -30,6 +32,8 @@ async function waitForRunnerRegistered(label) {
const quietPeriodSeconds = 30
let waitSeconds = 0

core.info(`RUNNER to wait: ${label}`) // DEBUG

core.info(
`Waiting ${quietPeriodSeconds}s for ${config.input.backend} instance to be registered in GitHub as a new self-hosted runner`
)
Expand Down

0 comments on commit c36e7c0

Please sign in to comment.