Skip to content

refactor!: use ops._main._Manager in Scenario (#1491) #15

refactor!: use ops._main._Manager in Scenario (#1491)

refactor!: use ops._main._Manager in Scenario (#1491) #15

name: Observability Charm Tests
on:
push:
branches:
- main
pull_request:
workflow_call:
jobs:
o11y-charm-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- charm-repo: canonical/alertmanager-k8s-operator
commit: ddd6c62cc30689b3d353c714b020cb309e59d00c # 2024-11-27T09:11:44Z
- charm-repo: canonical/prometheus-k8s-operator
commit: 0953ac0c87dc8912ed935f9130f21940923461e8 # rev218 2024-11-27T10:35:42Z
disabled: true # Waiting for an upstream PR: https://github.com/canonical/prometheus-k8s-operator/pull/639
- charm-repo: canonical/grafana-k8s-operator
commit: e821e40ac134468ece69c68ee9bc117b27c5f600 # 2024-11-27T11:34:26Z
steps:
- name: Checkout the ${{ matrix.charm-repo }} repository
uses: actions/checkout@v4
with:
repository: ${{ matrix.charm-repo }}
ref: ${{ matrix.commit }}
- name: Update 'ops' dependency in test charm to latest
run: |
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
- name: Install dependencies
run: pip install tox~=4.2
- name: Run the charm's unit tests
if: ${{ !(matrix.disabled) }}
run: tox -vve unit
- name: Run the charm's static analysis checks
if: ${{ !(matrix.disabled) }}
run: tox -vve static-charm