Skip to content

feat(arc): let the ARC role manage an install that uses its own names #6

feat(arc): let the ARC role manage an install that uses its own names

feat(arc): let the ARC role manage an install that uses its own names #6

name: Mesh integration
# Brings up three k3s nodes in Docker and joins them through Headscale with the cluster role (tests/mesh/run.sh), once per scenario: headscale_hosted, headscale_in_cluster, and the headscale_existing policy check. Only on changes that can affect how nodes join the mesh.
#
# Runs on GitHub-hosted ubuntu-latest, whose Docker daemon runs the privileged containers the test needs (k3s, and Tailscale inside it). The work directory sits under runner.temp, which the job always has write access to.
on:
pull_request:
paths:
- roles/github_runner_cluster/**
- plugins/filter/**
- docker-compose.yml
- k3s/**
- playbooks/recover_in_cluster_mesh.yml
- tests/mesh/**
- .github/workflows/mesh-integration.yml
workflow_dispatch:
concurrency:
group: mesh-integration-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
mesh:
name: Mesh (${{ matrix.scenario }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
scenario: [existing, hosted, in_cluster]
env:
COMPOSE_VERSION: v5.5.1
steps:
- uses: actions/checkout@v7
- name: Install the pinned Docker Compose
# Always the pinned version, not whatever the runner has: ubuntu-latest's own Compose recreated every node container when the role ran a second time, which the pinned version does not. The user plugin directory takes precedence over the system one.
run: |
set -euo pipefail
docker version --format 'Docker Engine {{.Server.Version}}'
case "$(uname -m)" in
x86_64) arch=x86_64 ;;
aarch64 | arm64) arch=aarch64 ;;
*) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac
mkdir -p "${HOME}/.docker/cli-plugins"
base="https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-linux-${arch}"
curl -fsSL -o "${RUNNER_TEMP}/docker-compose" "$base"
echo "$(curl -fsSL "${base}.sha256" | cut -d' ' -f1) ${RUNNER_TEMP}/docker-compose" | sha256sum -c -
install -m 0755 "${RUNNER_TEMP}/docker-compose" "${HOME}/.docker/cli-plugins/docker-compose"
docker compose version
- name: Install Ansible
run: |
set -euo pipefail
if ! python3 -m venv "${RUNNER_TEMP}/venv" 2>/dev/null; then
sudo apt-get update -qq
sudo apt-get install -y -qq python3-venv
python3 -m venv "${RUNNER_TEMP}/venv"
fi
"${RUNNER_TEMP}/venv/bin/pip" install --quiet --prefer-binary ansible-core
"${RUNNER_TEMP}/venv/bin/ansible-galaxy" collection install -r ansible/requirements.yml -p "${RUNNER_TEMP}/collections"
echo "${RUNNER_TEMP}/venv/bin" >> "$GITHUB_PATH"
- name: Run the ${{ matrix.scenario }} scenario
env:
ANSIBLE_COLLECTIONS_PATH: ${{ runner.temp }}/collections
GRTEST_WORK: ${{ runner.temp }}/grtest-mesh
run: tests/mesh/run.sh "${{ matrix.scenario }}"
required-checks:
name: Mesh integration result
needs: [mesh]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Fail if any scenario failed or was cancelled
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more scenarios did not succeed:"
echo '${{ toJSON(needs) }}'
exit 1
fi