Skip to content

Commit

Permalink
Move CI to homelab (#214)
Browse files Browse the repository at this point in the history
- adds port support for CI action
- moves ci from X to Homelab
  • Loading branch information
mcdope authored Jan 1, 2024
1 parent 2eeaaff commit 718ca75
Show file tree
Hide file tree
Showing 4 changed files with 302 additions and 242 deletions.
200 changes: 111 additions & 89 deletions .github/workflows/build-and-test-on-own-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
DoMagicOnConfiguredCustomRunner:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Install sshpass on Github runner
Expand All @@ -18,138 +18,160 @@ jobs:
run: exit 0
- name: Check for lockfile and wait if it exists
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "while [ -f .tests-running ]; do sleep 2; done"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "while [ -f .tests-running ]; do sleep 2; done"
- name: Create lockfile
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "touch .tests-running"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "touch .tests-running"
- name: Install requirements
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "sudo apt install libudisks2-dev libxml2-dev python libpam0g-dev devscripts debhelper dh-systemd dkms pkg-config gir1.2-glib-2.0 libglib2.0-dev"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "sudo apt --yes install fdisk libudisks2-dev libxml2-dev python-is-python3 libpam0g-dev devscripts debhelper dkms pkg-config gir1.2-glib-2.0 libglib2.0-dev"
- name: git clone
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "rm -rf ~/pam_usb_$GITHUB_RUN_ID; mkdir ~/pam_usb_$GITHUB_RUN_ID; cd ~/pam_usb_$GITHUB_RUN_ID && git clone https://github.com/mcdope/pam_usb.git ."
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "rm -rf ~/pam_usb_$GITHUB_RUN_ID; mkdir ~/pam_usb_$GITHUB_RUN_ID; cd ~/pam_usb_$GITHUB_RUN_ID && git clone https://github.com/mcdope/pam_usb.git ."
- name: git fetch --all
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && git fetch --all"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && git fetch --all"
- name: git reset --hard
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && git reset --hard"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && git reset --hard"
- name: git switch -f
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
REF_TO_CHECKOUT: ${{ github.head_ref }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && git switch -f $REF_TO_CHECKOUT || git switch -f master"
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && git switch -f $REF_TO_CHECKOUT || git switch -f master"
- name: git pull
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && git pull"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && git pull"
- name: remove previously installed package (ensure no config)
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "sudo apt purge --yes libpam-usb || exit 0"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "sudo apt purge --yes libpam-usb || exit 0"
- name: remove previously built packages
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~ && rm *.deb || exit 0"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~ && rm *.deb || exit 0"
- name: remove previous fakestick if existing
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./umount-image.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./umount-image.sh"
- name: make deb
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && make deb"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && make deb"
- name: install created .deb package
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID && sudo DEBIAN_FRONTEND=noninteractive apt install --reinstall -yq ../*.deb"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID && sudo DEBIAN_FRONTEND=noninteractive apt install --reinstall -yq ../*.deb"
- name: disable deny_remote option # ... else the verify test cant be successful if run from a remote host like Github actions runner
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "sudo sed -i 's/<defaults>/<defaults><option name=\"deny_remote\">false<\/option>/g' /etc/security/pam_usb.conf"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "sudo sed -i 's/<defaults>/<defaults><option name=\"deny_remote\">false<\/option>/g' /etc/security/pam_usb.conf"
# @todo: to include this, we need an uninstall at the end first - currently we require this to be present on the target host
# - name: setup dummy-hcd module for fake usb stick
# run: cd tests/can-actually-be-used && ./setup-dummyhcd.sh
- name: load dummy-hcd module
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./prepare-mounting.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./prepare-mounting.sh"
- name: create fake usb stick image
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./create-image.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./create-image.sh"
- name: Insert/partition/format/mount fake usb stick
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./mount-image.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./mount-image.sh"
- name: execute test cases
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./run-tests.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./run-tests.sh"
- name: cleanup - umount & remove image file, pads, mountpoint
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./umount-image.sh"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "cd ~/pam_usb_$GITHUB_RUN_ID/tests/can-actually-be-used && ./umount-image.sh"
- name: Remove lockfile
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "rm .tests-running"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "rm .tests-running"
- name: cleanup - remove installed package
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "sudo apt purge --yes libpam-usb"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "sudo apt purge --yes libpam-usb"
- name: Cleanup directory
env:
TEST_RUNNER_HOST: ${{ secrets.TEST_RUNNER_HOST }}
TEST_RUNNER_USER: ${{ secrets.TEST_RUNNER_USER }}
TEST_RUNNER_PASS: ${{ secrets.TEST_RUNNER_PASS }}
run: sshpass -p "$TEST_RUNNER_PASS" ssh -o StrictHostKeyChecking=no $TEST_RUNNER_USER@$TEST_RUNNER_HOST "rm -rf ~/pam_usb_$GITHUB_RUN_ID"
TEST_RUNNER_HOST_NEW: ${{ secrets.TEST_RUNNER_HOST_NEW }}
TEST_RUNNER_USER_NEW: ${{ secrets.TEST_RUNNER_USER_NEW }}
TEST_RUNNER_PASS_NEW: ${{ secrets.TEST_RUNNER_PASS_NEW }}
TEST_RUNNER_PORT_NEW: ${{ secrets.TEST_RUNNER_PORT_NEW }}
run: sshpass -p "$TEST_RUNNER_PASS_NEW" ssh -o StrictHostKeyChecking=no -p $TEST_RUNNER_PORT_NEW $TEST_RUNNER_USER_NEW@$TEST_RUNNER_HOST_NEW "rm -rf ~/pam_usb_$GITHUB_RUN_ID"

2 changes: 1 addition & 1 deletion .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
lint:
name: DevSkim
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
Expand Down
Loading

0 comments on commit 718ca75

Please sign in to comment.