ci: smoke test against k8s as well as microk8s #2520
Workflow file for this run
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: 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: 6cce771de5d4a33f751de0ce34af85f0c17fd3d3 # 2025-02-25T15:17:48Z | |
- charm-repo: canonical/postgresql-k8s-operator | |
commit: e92a015465cd7556f41cdd1ff51bb02590309a0e # 2025-02-26T21:59:57Z | |
- charm-repo: canonical/mysql-operator | |
commit: cd09784bba60dd77554da97b2a9bc4ef323cd586 # rev363 rev362 2025-02-26T20:13:40Z | |
- charm-repo: canonical/mysql-k8s-operator | |
commit: b353fdb5b9e8ee59aefac4eb4fe3c53af4790bf6 # rev241 rev240 2025-02-25T12:29:30Z | |
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~=2.0 | |
- 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 | |
fi | |
- name: Install dependencies | |
run: pip install tox~=4.2 | |
- name: Run the charm's unit tests | |
run: tox -vve unit |