🧪 Test Ubuntu Jammy (22.04 LTS) runner #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🧪 Test Ubuntu Jammy (22.04 LTS) runner | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "images/rootless-ubuntu-jammy.Dockerfile" | |
- "images/**.sh" | |
- "images/software/*" | |
- ".github/workflows/test-jammy.yml" | |
jobs: | |
build: | |
name: Build test image | |
runs-on: ubuntu-latest # use the GitHub-hosted runner to build the imag | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
file: "images/rootless-ubuntu-jammy.Dockerfile" | |
push: true | |
tags: ghcr.io/some-natalie/kubernoodles/rootless-ubuntu-jammy:test | |
deploy: | |
name: Deploy test image to `test-runners` namespace | |
runs-on: ubuntu-latest # use the GitHub-hosted runner to deploy the image | |
needs: [build] | |
environment: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Write out the kubeconfig info | |
run: | | |
echo ${{ secrets.DEPLOY_ACCOUNT }} | base64 -d > /tmp/config | |
- name: Update deployment (using latest chart of actions-runner-controller-charts/auto-scaling-runner-set) | |
run: | | |
helm install test-jammy-dind \ | |
--namespace "test-runners" \ | |
--set githubConfigSecret.github_app_id="${{ vars.ARC_APP_ID }}" \ | |
--set githubConfigSecret.github_app_installation_id="${{ vars.ARC_INSTALL_ID }}" \ | |
--set githubConfigSecret.github_app_private_key="${{ secrets.ARC_APP_PRIVATE_KEY }}" \ | |
-f deployments/helm-jammy-dind-test.yml \ | |
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set | |
env: | |
KUBECONFIG: /tmp/config | |
- name: Remove kubeconfig info | |
run: rm -f /tmp/config | |
- name: Wait 5 minutes to let the new pod come up | |
run: sleep 300 | |
test: | |
name: Run tests! | |
runs-on: [test-jammy-dind] | |
needs: [deploy] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Print debug info | |
uses: ./tests/debug | |
- name: Sudo fails | |
uses: ./tests/sudo-fails | |
- name: Docker tests | |
uses: ./tests/docker | |
- name: Container Action test | |
uses: ./tests/container | |
remove-deploy: | |
name: Delete test image deployment | |
runs-on: ubuntu-latest # use the GitHub-hosted runner to remove the image | |
needs: [test] | |
environment: test | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Write out the kubeconfig info | |
run: | | |
echo ${{ secrets.DEPLOY_ACCOUNT }} | base64 -d > /tmp/config | |
- name: Deploy | |
run: | | |
helm uninstall test-jammy-dind --namespace "test-runners" | |
env: | |
KUBECONFIG: /tmp/config | |
- name: Remove kubeconfig info | |
run: rm -f /tmp/config |