File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Test Self-Hosted Runner Availability
1+ name : CI Pipeline
22
33on :
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
189jobs :
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
You can’t perform that action at this time.
0 commit comments