Skip to content

refactor: deprecate StatusBase.register decorator (#1384) #6

refactor: deprecate StatusBase.register decorator (#1384)

refactor: deprecate StatusBase.register decorator (#1384) #6

name: Data Charm Tests
on:
push:
branches:
- main
pull_request:
workflow_call:
jobs:
db-charm-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- charm-repo: canonical/postgresql-operator
commit: 01cfd3e268ecd5024ded6bb6aede43ff85417b78 # 2024-09-11T16:07:20Z
- charm-repo: canonical/postgresql-k8s-operator
commit: f203e4d9d3ab9856b5dc0786217fce8428384e90 # 2024-09-16T12:00:58Z
# Waiting for an upstream PR:
# https://github.com/canonical/mysql-operator/pull/519
#- charm-repo: canonical/mysql-operator
# commit: 4ff2dc867a1586d43a93d0017cc648d591fc9886 # 2024-09-13T15:38:12Z
- charm-repo: canonical/mysql-k8s-operator
commit: 2009919583eddad22656b9b4ebe95adbcd518c0f # rev199 rev198 2024-09-16T18:14:16Z
steps:
- name: Checkout the ${{ matrix.charm-repo }} repository
uses: actions/checkout@v4
with:
repository: ${{ matrix.charm-repo }}
ref: ${{ matrix.commit }}
- name: Checkout the operator repository
uses: actions/checkout@v4
with:
path: myops
- name: Install patch dependencies
run: pip install poetry~=1.6
- name: Update 'ops' dependency in test charm to latest
run: |
if [ -e "requirements.txt" ]; then
sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt
else
sed -i -e "s/^ops[ ><=].*/ops = {path = \"myops\"}/" pyproject.toml
poetry lock --no-update
fi
- name: Install dependencies
run: pip install tox~=4.2
- name: Run the charm's unit tests
run: tox -vve unit