-
Notifications
You must be signed in to change notification settings - Fork 23
53 lines (51 loc) · 1.85 KB
/
integration_sh.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Self-Hosted Runner for Integration Tests
on:
workflow_dispatch:
env:
SH_RUNNER_MANAGE_TOKEN: ${{secrets.SH_RUNNER_MANAGE_TOKEN }}
jobs:
# This job creates a self-hosted runner attached to the
# test organization.
Integration_SH_Runner:
name: Ephemeral Self-Hosted Runner
runs-on: ubuntu-latest
timeout-minutes: 16
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Configure and Run Self-Hosted Runner
run: |
pip install requests
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64-2.316.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.316.1/actions-runner-linux-x64-2.316.1.tar.gz
tar xzf ./actions-runner-linux-x64-2.316.1.tar.gz
python ../test/runner_helper.py register
nohup ./run.sh &
- name: Sleep
run: python3 -c "import time; time.sleep(840)"
- name: Remove Runner
run: |
cd actions-runner
python ../test/runner_helper.py remove
SH_Runner_Cleanup:
# Removes the self-hosted runner forcibly in the event the cleanup operation
# did not work.
name: Remove Self-Hosted Runner
runs-on: ubuntu-latest
needs: Integration_SH_Runner
if: failure()
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Force Remove SH Runner
run: |
pip install requests
python test/runner_helper.py force_remove