mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-24 02:51:28 -08:00
Bumps the minor-and-patches group with 5 updates: | Package | From | To | | --- | --- | --- | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.5.2` | `0.5.3` | | [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `8.0.0` | `8.1.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `8.1.0` | `8.1.1` | | [actions/cache](https://github.com/actions/cache) | `5.0.4` | `5.0.5` | Updates `zizmorcore/zizmor-action` from 0.5.2 to 0.5.3 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/71321a20a9ded102f6e9ce5718a2fcec2c4f70d8...b1d7e1fb5de872772f31590499237e7cce841e8e) Updates `astral-sh/setup-uv` from 8.0.0 to 8.1.0 - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/cec208311dfd045dd5311c1add060b2062131d57...08807647e7069bb48b6ef5acd8ec9567f424441b) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `peter-evans/create-pull-request` from 8.1.0 to 8.1.1 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/c0f553fe549906ede9cf27b5156039d195d2ece0...5f6978faf089d4d20b00c7766989d076bb2fc7f1) Updates `actions/cache` from 5.0.4 to 5.0.5 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/668228422ae6a00e4ad889ee87cd7109ec5666a7...27d5ce7f107fe9357f9df03efb73ab90386fccae) --- updated-dependencies: - dependency-name: zizmorcore/zizmor-action dependency-version: 0.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patches - dependency-name: astral-sh/setup-uv dependency-version: 8.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patches - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patches - dependency-name: peter-evans/create-pull-request dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patches - dependency-name: actions/cache dependency-version: 5.0.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-and-patches ... Signed-off-by: dependabot[bot] <[email protected]>
216 lines
7.6 KiB
YAML
216 lines
7.6 KiB
YAML
# Copyright 2024-2025 New Vector Ltd
|
||
# Copyright 2025-2026 Element Creations Ltd
|
||
#
|
||
# SPDX-License-Identifier: AGPL-3.0-only
|
||
|
||
name: Run PyTest tests - Integration and Manifests
|
||
|
||
on:
|
||
pull_request:
|
||
push:
|
||
branches:
|
||
- main
|
||
- 'maintenance/*'
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: read
|
||
|
||
concurrency:
|
||
group: ${{ github.workflow }}-${{ github.ref }}
|
||
cancel-in-progress: true
|
||
|
||
env:
|
||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
GHCR_USERNAME: ${{ github.actor }}
|
||
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
|
||
jobs:
|
||
pytest-setup:
|
||
runs-on: ubuntu-latest
|
||
outputs:
|
||
envFiles: ${{ steps.data.outputs.envFiles }}
|
||
manifestTests: ${{ steps.data.outputs.manifestTests }}
|
||
upgradeFrom: ${{ steps.data.outputs.upgradeFrom }}
|
||
steps:
|
||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
fetch-depth: 0
|
||
fetch-tags: true
|
||
- id: data
|
||
run: |
|
||
echo "envFiles=$(find tests/integration/env -name '*.rc' | sed 's|tests/integration/env/||' | sed 's/.rc$//' | jq -ncR '{envFiles: [inputs]}')" | tee -a "$GITHUB_OUTPUT"
|
||
echo "manifestTests=$(find tests/manifests -name 'test_*.py' | sed 's|tests/manifests/||' | sed 's/.py$//' | jq -ncR '{manifestTests: [inputs]}')" | tee -a "$GITHUB_OUTPUT"
|
||
LATEST_TAG=$(git describe --abbrev=0 --tags --match '[0-9]*.[0-9]*.[0-9]*')
|
||
echo "upgradeFrom=$LATEST_TAG" | tee -a "$GITHUB_OUTPUT"
|
||
|
||
pytest-integration:
|
||
runs-on: ubuntu-latest
|
||
needs: pytest-setup
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
test-component: ${{ fromJSON(needs.pytest-setup.outputs.envFiles).envFiles }}
|
||
test-from-ref:
|
||
- "${{ github.event.pull_request.head.sha }}"
|
||
- "${{ needs.pytest-setup.outputs.upgradeFrom }}"
|
||
env:
|
||
MATRIX_TEST_COMPONENT: ${{ matrix.test-component }}
|
||
MATRIX_TEST_FROM_REF: ${{ matrix.test-from-ref }}
|
||
steps:
|
||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
fetch-depth: 0
|
||
fetch-tags: true
|
||
|
||
- name: Install uv
|
||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
||
with:
|
||
enable-cache: true
|
||
activate-environment: true
|
||
|
||
- name: Set up UV environment
|
||
run: uv sync
|
||
|
||
- name: Get current week number and home dir
|
||
id: cache-input
|
||
run: |
|
||
echo "week=$(date +%Y%U)" | tee -a "$GITHUB_OUTPUT"
|
||
echo "runner-home=$HOME" | tee -a "$GITHUB_OUTPUT"
|
||
|
||
- name: Restore pyhelm cache
|
||
id: cache-pyhelm
|
||
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||
with:
|
||
path: .pyhelm_cache
|
||
key: pyhelm-integration-cache-${{ hashFiles('tests/integration/fixtures/cluster.py') }}-week-${{ steps.cache-input.outputs.week }}
|
||
restore-keys: |
|
||
pyhelm-integration-cache-
|
||
|
||
- name: List pyhelm cache contents
|
||
run: |
|
||
echo "Listing contents of .pyhelm_cache:"
|
||
echo "GITHUB_WORKSPACE is $GITHUB_WORKSPACE, pwd is $(pwd)"
|
||
ls -la .pyhelm_cache || echo "Cache directory does not exist or is empty"
|
||
|
||
- name: Login to Dockerhub
|
||
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
||
if: ${{ github.event.pull_request.head.repo.full_name == 'element-hq/ess-helm' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
|
||
with:
|
||
registry: docker.io
|
||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
|
||
- uses: ./.github/actions/asdf-cache
|
||
with:
|
||
tool-versions: |
|
||
k3d 5.8.3
|
||
|
||
- uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0
|
||
|
||
- name: Checkout values files from previous ref
|
||
run: |
|
||
git checkout --no-overlay -f "${MATRIX_TEST_FROM_REF}" -- charts/matrix-stack tests/integration/env/
|
||
if: ${{ matrix.test-from-ref != github.event.pull_request.head.sha }}
|
||
|
||
- name: Deploy with pytest once
|
||
env:
|
||
PYTEST_CI_FIRST_STEP: "1"
|
||
# Drop me after releasing next 26.3.x
|
||
# We are changing the k3d ports range, so we cannot setup matrix-rtc with the old values
|
||
if: ${{ env.MATRIX_TEST_FROM_REF == '26.2.3' && !contains(env.MATRIX_TEST_COMPONENT, 'matrix-rtc') || env.MATRIX_TEST_FROM_REF != '26.2.3' }}
|
||
run: |
|
||
if [ -f "tests/integration/env/${MATRIX_TEST_COMPONENT}.rc" ]; then
|
||
# shellcheck source=/dev/null
|
||
. "tests/integration/env/${MATRIX_TEST_COMPONENT}.rc"
|
||
pytest-ess --test-suite "${MATRIX_TEST_COMPONENT}" --keep -- -vv
|
||
else
|
||
echo "The integration test does not exist in previous ref, skipping..."
|
||
fi
|
||
|
||
- name: Checkout values files back
|
||
run: |
|
||
git checkout --no-overlay -f HEAD -- charts/matrix-stack tests/integration/env/
|
||
|
||
- name: On upgrade, Synapse can restart, expect 429 to occur
|
||
run: |
|
||
echo "PYTEST_EXPECTED_HTTP_STATUS_CODES=429,502,504" >> "$GITHUB_ENV"
|
||
if: ${{ matrix.test-from-ref != github.event.pull_request.head.sha }}
|
||
|
||
- name: Test with pytest (upgrade or idempotent setup)
|
||
env:
|
||
PYTEST_CI_SECOND_STEP: "1"
|
||
run: |
|
||
# shellcheck source=/dev/null
|
||
. "tests/integration/env/${MATRIX_TEST_COMPONENT}.rc"
|
||
pytest-ess --test-suite "${MATRIX_TEST_COMPONENT}" --keep -- -vv
|
||
# syn2mas is a special case that cannot run twice by design
|
||
if: ${{ matrix.test-component != 'matrix-authentication-service-syn2mas' }}
|
||
|
||
- name: Save pyhelm cache
|
||
if: always() && steps.cache-pyhelm.outputs.cache-hit != 'true'
|
||
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||
with:
|
||
key: pyhelm-integration-cache-${{ hashFiles('tests/integration/fixtures/cluster.py') }}-week-${{ steps.cache-input.outputs.week }}
|
||
path: .pyhelm_cache
|
||
|
||
- name: Export logs
|
||
if: ${{ failure() }}
|
||
shell: bash
|
||
run: |
|
||
collect-ess-logs --system-logs
|
||
|
||
- name: Upload logs
|
||
if: ${{ failure() }}
|
||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||
with:
|
||
name: ess-helm-logs-${{ matrix.test-component }}-${{ matrix.test-from-ref }}
|
||
path: ess-helm-logs
|
||
retention-days: 1
|
||
|
||
pytest-manifests:
|
||
runs-on: ubuntu-latest
|
||
needs: pytest-setup
|
||
strategy:
|
||
fail-fast: false
|
||
matrix:
|
||
manifest-test: ${{ fromJSON(needs.pytest-setup.outputs.manifestTests).manifestTests }}
|
||
steps:
|
||
- name: Checkout
|
||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||
with:
|
||
persist-credentials: false
|
||
|
||
- name: Install uv
|
||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
||
with:
|
||
enable-cache: true
|
||
activate-environment: true
|
||
|
||
- name: Set up UV environment
|
||
run: uv sync
|
||
|
||
# Helm >= 3.19.5 (including Helm v4) have https://github.com/helm/helm/issues/31643
|
||
# which breaks one of the Ingress tests
|
||
- name: Pin Helm with asdf
|
||
uses: ./.github/actions/asdf-cache
|
||
with:
|
||
tool-versions: |
|
||
helm 3.19.4
|
||
|
||
- name: Restore pytest cache
|
||
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
||
with:
|
||
path: .pytest_cache
|
||
key: pytest-manifests-cache-${{ matrix.manifest-test }}-${{ hashFiles('charts/matrix-stack/values.yaml') }}
|
||
restore-keys: |
|
||
pytest-manifests-cache-
|
||
|
||
- name: Run our manifest test
|
||
env:
|
||
MANIFEST_TEST: ${{ matrix.manifest-test }}
|
||
run: pytest -vv "tests/manifests/${MANIFEST_TEST}.py"
|