Skip to content

Commit

Permalink
Add workflow to check aarch64 setup script (#2028)
Browse files Browse the repository at this point in the history
* Add workflow to check aarch64 setup script

* Add sudo

* Fix step name

* Do not copy authorized keys if GITHUB_ACTIONS env var exists

* Fix

* Fix typo

* Fix

* Final fix

* Fix
  • Loading branch information
mathbunnyru authored Nov 6, 2023
1 parent 78fe45a commit 5f8f5b6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/aarch64-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test aarch64-runner setup script

on:
schedule:
# Weekly, at 03:00 on Monday UTC time
- cron: "0 3 * * 1"
pull_request:
paths:
- ".github/workflows/aarch64-setup.yml"
- "aarch64-runner/setup.sh"
push:
branches:
- main
paths:
- ".github/workflows/aarch64-setup.yml"
- "aarch64-runner/setup.sh"
workflow_dispatch:

jobs:
test-script:
# The script itself is not aarch64 specific
# It is easier to test on ubuntu-latest
runs-on: ubuntu-latest

steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4

- name: Run setup script ✅
run: sudo ./aarch64-runner/setup.sh
2 changes: 2 additions & 0 deletions aarch64-runner/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ apt-get upgrade --yes
echo "Setting up runner-user, who will run GitHub Actions runner"
adduser --disabled-password --gecos "" ${GITHUB_RUNNER_USER}
mkdir /home/${GITHUB_RUNNER_USER}/.ssh/
set +e
cp "/home/${SUDO_USER}/.ssh/authorized_keys" "/home/${GITHUB_RUNNER_USER}/.ssh/authorized_keys"
set -e
chown --recursive ${GITHUB_RUNNER_USER}:${GITHUB_RUNNER_USER} /home/${GITHUB_RUNNER_USER}/.ssh

echo "Setting up python3"
Expand Down

0 comments on commit 5f8f5b6

Please sign in to comment.