Skip to content

Commit 2085091

Browse files
committed
Add workflow for updating custom GitHub runner.
1 parent 071429b commit 2085091

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

.github/workflows/integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ jobs:
911911
# ARM Mac requires a firestore.json to specify the host as 127.0.0.1 rather than localhost.
912912
# Otherwise the Firestore emulator cannot connect, probably because localhost is ipv6.
913913
echo '{"emulators":{"firestore":{"port":"8080","host":"127.0.0.1"}}}' > firebase.json
914-
914+
echo "::warning ::Firestore emulator version: $(firebase --version)"
915915
set -x
916916
firebase emulators:exec --only firestore --project demo-example \
917917
'python scripts/gha/desktop_tester.py --testapp_dir testapps --logfile_name "desktop-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.ssl_variant }}" --cmd_prefix='"\"${cmd_prefix}\""
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Update custom GitHub runners
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
runner_list:
7+
description: 'Runner hostname to update (comma-separated)'
8+
default: 'fplmac1,fplmac2'
9+
required: true
10+
update_tools:
11+
description: 'Update tools?'
12+
default: '1'
13+
required: true
14+
update_os:
15+
description: 'Update OS?'
16+
default: '0'
17+
required: true
18+
19+
env:
20+
GITHUB_TOKEN: ${{ github.token }}
21+
22+
jobs:
23+
update_custom_runners:
24+
name: update-custom-runner-${{ matrix.runner_hostname }}
25+
runs-on: [self-hosted, '${{ matrix.runner_hostname }}' ]
26+
if: ${{ github.event.input.runner_list }}
27+
28+
strategy:
29+
matrix:
30+
runner_hostname: ${{ github.event.input.runner_list }}
31+
32+
steps:
33+
- name: Update tools
34+
if: ${{ github.event.inputs.update_tools }}
35+
shell: bash
36+
run: |
37+
echo "npm install -g firebase-tools"
38+
39+
- name: Check for OS updates
40+
shell: bash
41+
run: |
42+
if softwareupdate -l -r | grep -q 'No new software available'
43+
then
44+
echo "::warning ::No OS updates available."
45+
else
46+
echo "softwareupdate -l -r | tr '\n' '|' | sed 's/|/%0A/g' | sed "
47+
48+
- name: Update OS
49+
if: ${{ github.event.inputs.update_os }}
50+
shell: bash
51+
run: |
52+
echo "softwareupdate -i -r -f"

0 commit comments

Comments
 (0)