From c36e7c0afe9c6995d06c9924380390349cfa9d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Test=C3=A9?= Date: Tue, 19 Nov 2024 11:16:03 +0100 Subject: [PATCH] DEBUG: find registered runner --- .github/workflows/ci.yml | 130 +++++++++++++++++++-------------------- dist/index.js | 6 +- src/gh.js | 6 +- 3 files changed, 75 insertions(+), 67 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6987a7..ab97626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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) diff --git a/dist/index.js b/dist/index.js index ea7be2e..6514211 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49653,7 +49653,9 @@ async function getRunner(label) { repo: config.githubContext.repo } ) - const foundRunners = _.filter(runners, { labels: [{ name: label }] }) + core.info(`runners collected: ${runners}`) + const foundRunners = _.filter(runners, { name: label }) + core.info(`runners FOUND: ${foundRunners}`) return foundRunners.length > 0 ? foundRunners[0] : null } catch (error) { return null @@ -49666,6 +49668,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` ) diff --git a/src/gh.js b/src/gh.js index 0f1455e..633f68a 100644 --- a/src/gh.js +++ b/src/gh.js @@ -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 @@ -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` )