Skip to content

Commit 04a88e1

Browse files
committed
Try using an existing GHA with the same implementation
1 parent da66ddf commit 04a88e1

1 file changed

Lines changed: 23 additions & 28 deletions

File tree

.github/workflows/entrypoint.yml

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
1-
name: Test Self-Hosted Runner Availability
1+
name: CI Pipeline
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
7-
workflow_dispatch:
8-
inputs:
9-
label:
10-
description: Label for self-hosted runner
11-
required: true
12-
default: self-hosted
13-
fallback:
14-
description: Fallback runner
15-
required: true
16-
default: thevickypedia-default
178

189
jobs:
19-
runner:
20-
uses: thevickypedia/runner/action.yml@main
21-
with:
22-
label: '${{ github.event.inputs.label }}'
23-
fallback: '${{ github.event.inputs.fallback }}'
10+
determine-runner:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
runner: ${{ steps.runner-selector.outputs.use-runner }}
14+
steps:
15+
- name: Select self-hosted runner with fallback
16+
id: runner-selector
17+
uses: mendesbarreto/runner-selector-action@v1
18+
with:
19+
primary-runner: "linux-arm64"
20+
fallback-runner: "thevickypedia-default"
21+
github-token: ${{ secrets.GIT_TOKEN }}
22+
check-org-runners: true
2423

25-
build:
26-
needs: runner
27-
runs-on: ${{ needs.runner.outputs.label }}
24+
build-and-test:
25+
needs: determine-runner
26+
runs-on: ${{ fromJson(needs.determine-runner.outputs.runner) }}
2827
steps:
29-
- uses: actions/checkout@v4
30-
- run: |
31-
if [ "${{ needs.runner.outputs.available }}" == "true" ]; then
32-
echo "✅ Using self-hosted runner"
33-
else
34-
echo "⚙️ Using fallback runner"
35-
fi
36-
echo "${{ needs.runner.outputs.label }} ${{ runner.name }} ${{runner.os }}-${{ runner.arch }}"
37-
shell: bash
28+
- name: Print selected runner
29+
run: echo "This job is running on ${{ needs.determine-runner.outputs.runner }}"
30+
31+
- name: Checkout code
32+
uses: actions/checkout@v4

0 commit comments

Comments
 (0)