Skip to content

Automatic image dependency bumps #165

Automatic image dependency bumps

Automatic image dependency bumps #165

name: 🧪 Test Ubuntu Numbat (24.04 LTS) runner
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- "images/rootless-ubuntu-numbat.Dockerfile"
- "images/**.sh"
- "images/software/*"
- ".github/workflows/test-numbat-dind.yml"
jobs:
build:
name: Build test image
runs-on: ubuntu-latest # use the GitHub-hosted runner to build the image
steps:
- name: Set release id
run: echo "SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Set up build summary
run: |
echo '### Build summary 🚀' >> $GITHUB_STEP_SUMMARY
echo ' ' >> $GITHUB_STEP_SUMMARY
echo '- Changes that produced this build [here](${{ github.server_url }}/${{ github.repository }}/commit/${{ env.SHA_SHORT }}) ' >> $GITHUB_STEP_SUMMARY
echo '- Full code at this point in time [here](${{ github.server_url }}/${{ github.repository }}/tree/${{ env.SHA_SHORT }})' >> $GITHUB_STEP_SUMMARY
echo ' ' >> $GITHUB_STEP_SUMMARY
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Login to GHCR
uses: docker/login-action@371161bbe7024a29a25c5e19bfcbc0804fe9ad2c # v4.5.2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
file: "images/rootless-ubuntu-numbat.Dockerfile"
push: true
tags: ghcr.io/some-natalie/kubernoodles/rootless-ubuntu-numbat:test
deploy:
name: Deploy test image to `test-runners` namespace
runs-on: ubuntu-latest # use the GitHub-hosted runner to deploy to test
needs: [build]
environment: test
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# set up minikube
- name: Set up minikube on the runner
uses: medyagh/setup-minikube@e9e035a86bbc3caea26a450bd4dbf9d0c453682e # latest
# set up cluster configs
# local storage and the runner role for the k8s mode runner hooks
- name: Set up local storage
shell: bash
run: |
kubectl create namespace "test-runners"
kubectl create namespace "ghec-runners"
kubectl apply -f ./cluster-configs/k8s-mode-storage.yml
kubectl apply -f ./cluster-configs/runner-role.yml
- name: Install Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
- name: Deploy ARC
shell: bash
run: |
helm install arc \
--namespace "arc-systems" \
--create-namespace \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller \
--set image.tag=0.14.2
- name: Update deployment (using latest chart of actions-runner-controller-charts/auto-scaling-runner-set)
shell: bash
run: |
helm install test-numbat-dind \
--namespace "test-runners" \
--set-string githubConfigSecret.github_app_id="${{ vars.ARC_APP_ID }}" \
--set-string githubConfigSecret.github_app_installation_id="${{ vars.ARC_INSTALL_ID }}" \
--set-string githubConfigSecret.github_app_private_key="${{ secrets.ARC_APP_PRIVATE_KEY }}" \
-f deployments/helm-numbat-dind-test.yml \
oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set \
--version 0.14.2
- name: Sleep for 5 minutes to run tests on the runners
shell: bash
run: sleep 300
- name: Remove the runner deployment
shell: bash
run: |
helm uninstall test-numbat-dind --namespace "test-runners"
- name: Output removal
shell: bash
run: |
echo ' ' >> $GITHUB_STEP_SUMMARY
echo '🧹 Test deployment removed' >> $GITHUB_STEP_SUMMARY
test:
name: Run tests!
runs-on: [test-numbat-dind]
needs: [build]
timeout-minutes: 5
steps:
- name: Setup test summary
run: |
echo '### Test summary 🧪' >> $GITHUB_STEP_SUMMARY
echo ' ' >> $GITHUB_STEP_SUMMARY
echo '- ✅ runner builds and deploys' >> $GITHUB_STEP_SUMMARY
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Print debug info
uses: ./tests/debug
- name: Sudo fails
uses: ./tests/sudo-fails
- name: Docker tests
uses: ./tests/docker
- name: Container Action test
id: container
continue-on-error: true
uses: ./tests/container
- name: Log container success (if applicable)
if: steps.container.outcome == 'success'
run: |
echo '- ✅ container action succeeded' >> $GITHUB_STEP_SUMMARY
- name: Log container failure (if applicable)
if: steps.container.outcome == 'failure'
run: |
echo '- ❌ container action failed' >> $GITHUB_STEP_SUMMARY