[chore][CI] Remove EOL distros from test matrices #4357
Workflow file for this run
This file contains hidden or 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: installer-script-test | |
# Only run tests for main branch or if the PR has relevant changes | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- '.github/workflows/installer-script-test.yml' | |
- 'packaging/installer/install.sh' | |
- 'packaging/tests/instrumentation/**' | |
- 'packaging/tests/helpers/**' | |
- 'packaging/tests/images/**' | |
- 'packaging/tests/installer_test.py' | |
- 'packaging/tests/requirements.txt' | |
concurrency: | |
group: installer-script-test-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
installer-test-matrix: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Get distros | |
id: get-matrix | |
run: | | |
# create test matrix for distro images and archs | |
dockerfiles=$(ls packaging/tests/images/deb/Dockerfile.* packaging/tests/images/rpm/Dockerfile.* | cut -d '.' -f2- | sort -u) | |
if [ -z "$dockerfiles" ]; then | |
echo "Failed to get dockerfiles from packaging/tests/images!" >&2 | |
exit 1 | |
fi | |
distro=$(for d in $dockerfiles; do echo -n "\"$d\","; done) | |
arch='"amd64","arm64"' | |
instrumentation='"none","preload","systemd"' | |
# amazonlinux-2 requires cgroup v1, only available on version 20.04 that doesn't have an arm runner | |
exclude='{"DISTRO": "amazonlinux-2", "ARCH": "arm64"}' | |
matrix="{\"DISTRO\": [${distro%,}], \"ARCH\": [${arch}], \"INSTRUMENTATION\": [${instrumentation}], \"exclude\": [${exclude}]}" | |
echo "$matrix" | jq | |
echo "matrix=${matrix}" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.matrix }} | |
linux-installer-script-test: | |
# Amazon Linux 2 uses cgroup v1 | |
# Ubuntu 24.04 uses cgroup v2 | |
# Fallback to Ubuntu 20.04 when appropriate | |
runs-on: ubuntu-${{ matrix.DISTRO != 'amazonlinux-2' && '24.04' || '20.04' }}${{ matrix.ARCH == 'arm64' && '-arm' || '' }} | |
timeout-minutes: 90 | |
needs: installer-test-matrix | |
strategy: | |
matrix: ${{ fromJSON(needs.installer-test-matrix.outputs.matrix) }} | |
fail-fast: false | |
env: | |
PYTHON_VERSION: '3.13' | |
PIP_VERSION: '24.2' | |
REQUIREMENTS_PATH: "packaging/tests/requirements.txt" | |
steps: | |
- name: Check out the codebase. | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pip' | |
cache-dependency-path: ${{ env.REQUIREMENTS_PATH }} | |
- name: Install pytest | |
run: | | |
if which pip; then | |
pip install --upgrade 'pip==${{ env.PIP_VERSION }}' | |
else | |
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | |
python get-pip.py 'pip==${{ env.PIP_VERSION }}' | |
fi | |
pip install -r "${{ env.REQUIREMENTS_PATH }}" | |
- name: Test installer script | |
id: pytest | |
continue-on-error: true | |
run: | | |
distro="${{ matrix.DISTRO }}" | |
if [[ "$distro" = "amazonlinux-2" ]]; then | |
# workaround for pytest substring matching | |
distro="amazonlinux-2 and not amazonlinux-2023" | |
fi | |
if [[ "${{ matrix.INSTRUMENTATION }}" = "none" ]]; then | |
tests="$distro and ${{ matrix.ARCH }} and not instrumentation" | |
else | |
tests="$distro and ${{ matrix.ARCH }} and ${{ matrix.INSTRUMENTATION }}" | |
fi | |
python3 -u -m pytest -s --verbose -k "$tests" \ | |
packaging/tests/installer_test.py | |
# qemu, networking, running systemd in containers, etc., can be flaky | |
- name: Re-run failed tests | |
if: ${{ steps.pytest.outcome == 'failure' }} | |
run: | | |
distro="${{ matrix.DISTRO }}" | |
if [[ "$distro" = "amazonlinux-2" ]]; then | |
# workaround for pytest substring matching | |
distro="amazonlinux-2 and not amazonlinux-2023" | |
fi | |
if [[ "${{ matrix.INSTRUMENTATION }}" = "none" ]]; then | |
tests="$distro and ${{ matrix.ARCH }} and not instrumentation" | |
else | |
tests="$distro and ${{ matrix.ARCH }} and ${{ matrix.INSTRUMENTATION }}" | |
fi | |
python3 -u -m pytest -s --verbose -k "$tests" \ | |
--last-failed \ | |
packaging/tests/installer_test.py |