feat(coverage): ship Corbertura assets as a zip for our partner (#953) #43
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: E2E - Run tests | |
on: | |
workflow_dispatch: | |
inputs: | |
codenames: | |
description: 'Comma-separated list of codenames to run tests on (e.g. "mantic", "focal") - will test all supported releases if not specified' | |
type: string | |
required: false | |
repository: | |
description: 'Run tests with adsys from a fork (e.g. "username/adsys", defaults to the current repository if not specified)' | |
type: string | |
required: false | |
branch: | |
description: 'Run tests with adsys from a branch (defaults to main if not specified)' | |
type: string | |
required: false | |
push: | |
branches: | |
- main | |
tags: | |
- "*" | |
jobs: | |
supported-releases: | |
name: Build matrix for supported ADSys and Ubuntu releases | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-supported-releases.outputs.matrix }} | |
steps: | |
- name: Install needed binaries | |
run: | | |
sudo apt-get update | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y distro-info | |
- name: Build matrix | |
id: set-supported-releases | |
run: | | |
set -eu | |
all="$(distro-info --supported-esm) $(distro-info --supported)" | |
all="$(echo $all | tr ' ' '\n' | sort -u)" | |
releases="" | |
for r in ${all}; do | |
# Filter out unsupported LTS releases | |
if [ "${r}" = "trusty" -o "${r}" = "xenial" -o "${r}" = "bionic" ]; then | |
continue | |
fi | |
# FIXME: Noble images are currently broken, so avoid testing them for now | |
if [ "${r}" = "noble" ]; then | |
continue | |
fi | |
if [ -n "${releases}" ]; then | |
releases="${releases}, " | |
fi | |
releases="${releases}'${r}'" | |
done | |
echo matrix="${releases}" >> $GITHUB_OUTPUT | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
needs: | |
- supported-releases | |
strategy: | |
matrix: | |
codename: ${{ fromJSON(format('[{0}]', inputs.codenames || needs.supported-releases.outputs.matrix)) }} | |
fail-fast: false | |
env: | |
AD_PASSWORD: ${{ secrets.AD_PASSWORD }} | |
ADSYS_PRO_TOKEN: ${{ secrets.ADSYS_PRO_TOKEN }} | |
steps: | |
- name: Install required dependencies | |
run: | | |
sudo apt-get update | |
# Required for the XML to POL conversion | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-samba | |
- uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- uses: actions/checkout@v4 | |
with: | |
repository: ${{ inputs.repository || github.repository }} | |
ref: ${{ inputs.branch || github.ref }} | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set up SSH key | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.AZURE_SSH_KEY }}" > ~/.ssh/adsys-e2e.pem | |
chmod 600 ~/.ssh/adsys-e2e.pem | |
- name: Build adsys deb | |
run: go run ./e2e/cmd/run_tests/00_build_adsys_deb --codename ${{ matrix.codename }} | |
- name: Set up VPN connection | |
uses: ./.github/actions/azure-sstpc-vpn | |
with: | |
gateway: ${{ secrets.VPN_GATEWAY }} | |
ca: ${{ secrets.VPN_CA }} | |
cert: ${{ secrets.VPN_CERT }} | |
key: ${{ secrets.VPN_KEY }} | |
- name: Provision client VM | |
run: go run ./e2e/cmd/run_tests/01_provision_client | |
- name: Provision AD server | |
run: go run ./e2e/cmd/run_tests/02_provision_ad | |
- name: 'Test: non-Pro managers' | |
run: go run ./e2e/cmd/run_tests/03_test_non_pro_managers | |
- name: 'Test: Pro managers' | |
run: go run ./e2e/cmd/run_tests/04_test_pro_managers | |
- name: 'Test: PAM and Kerberos ticket cache' | |
run: go run ./e2e/cmd/run_tests/05_test_pam_krb5cc | |
- name: Collect logs on failure | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: e2e-logs-${{ matrix.codename }} | |
path: logs/ | |
- name: Deprovision resources | |
if: ${{ always() }} | |
run: | | |
# Check inventory status to see if we need to deprovision | |
if [ ! -f inventory.yaml ] || grep -q 'vmid: ""' inventory.yaml; then | |
echo "Inventory file not found, skipping deprovision" | |
exit 0 | |
fi | |
go run ./e2e/cmd/run_tests/99_deprovision |