Weekly Tests #11
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: Weekly Tests | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * SAT" | |
jobs: | |
tests-1: | |
name: Run first set of tests | |
runs-on: [self-hosted, small] | |
timeout-minutes: 1440 | |
outputs: | |
failed_tests: ${{ steps.collect-failed-tests.outputs.failed_tests }} | |
steps: | |
- name: Tests for charm-advanced-routing | |
uses: convictional/[email protected] | |
id: charm-advanced-routing | |
with: | |
owner: canonical | |
repo: charm-advanced-routing | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-apt-mirror | |
uses: convictional/[email protected] | |
id: charm-apt-mirror | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-apt-mirror | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charm-cloudsupport | |
uses: convictional/[email protected] | |
id: charm-cloudsupport | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-cloudsupport | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charm-duplicity | |
uses: convictional/[email protected] | |
id: charm-duplicity | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-duplicity | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for hardware-observer-operator | |
uses: convictional/[email protected] | |
id: hardware-observer-operator | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: hardware-observer-operator | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: COS integration tests for hardware-observer-operator | |
uses: convictional/[email protected] | |
id: hardware-observer-operator-integration | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: hardware-observer-operator | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: cos_integration.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-juju-backup-all | |
uses: convictional/[email protected] | |
id: charm-juju-backup-all | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-juju-backup-all | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-juju-local | |
uses: convictional/[email protected] | |
id: charm-juju-local | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-juju-local | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-kubernetes-service-checks | |
uses: convictional/[email protected] | |
id: charm-kubernetes-service-checks | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-kubernetes-service-checks | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-local-users | |
uses: convictional/[email protected] | |
id: charm-local-users | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-local-users | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charm-logrotated | |
uses: convictional/[email protected] | |
id: charm-logrotated | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-logrotated | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-nginx | |
uses: convictional/[email protected] | |
id: charm-nginx | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-nginx | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charm-openstack-service-checks | |
uses: convictional/[email protected] | |
id: charm-openstack-service-checks | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-openstack-service-checks | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-prometheus-blackbox-exporter | |
uses: convictional/[email protected] | |
id: charm-prometheus-blackbox-exporter | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-prometheus-blackbox-exporter | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Collect failed tests | |
id: collect-failed-tests | |
if: ${{ failure() }} | |
run: | | |
failed_tests="" | |
if [ "${{ steps.charm-advanced-routing.outcome }}" != "success" ]; then | |
failed_tests+="[charm-advanced-routing](https://github.com/canonical/charm-advanced-routing/actions), " | |
fi | |
if [ "${{ steps.charm-apt-mirror.outcome }}" != "success" ]; then | |
failed_tests+="[charm-apt-mirror](https://github.com/canonical/charm-apt-mirror/actions), " | |
fi | |
if [ "${{ steps.charm-cloudsupport.outcome }}" != "success" ]; then | |
failed_tests+="[charm-cloudsupport](https://github.com/canonical/charm-cloudsupport/actions), " | |
fi | |
if [ "${{ steps.charm-duplicity.outcome }}" != "success" ]; then | |
failed_tests+="[charm-duplicity](https://github.com/canonical/charm-duplicity/actions), " | |
fi | |
if [ "${{ steps.hardware-observer-operator.outcome }}" != "success" ]; then | |
failed_tests+="[hardware-observer-operator](https://github.com/canonical/hardware-observer-operator/actions), " | |
fi | |
if [ "${{ steps.hardware-observer-operator-integration.outcome }}" != "success" ]; then | |
failed_tests+="[hardware-observer-operator-integration](https://github.com/canonical/hardware-observer-operator/actions), " | |
fi | |
if [ "${{ steps.charm-juju-backup-all.outcome }}" != "success" ]; then | |
failed_tests+="[charm-juju-backup-all](https://github.com/canonical/charm-juju-backup-all/actions), " | |
fi | |
if [ "${{ steps.charm-juju-local.outcome }}" != "success" ]; then | |
failed_tests+="[charm-juju-local](https://github.com/canonical/charm-juju-local/actions), " | |
fi | |
if [ "${{ steps.charm-kubernetes-service-checks.outcome }}" != "success" ]; then | |
failed_tests+="[charm-kubernetes-service-checks](https://github.com/canonical/charm-kubernetes-service-checks/actions), " | |
fi | |
if [ "${{ steps.charm-local-users.outcome }}" != "success" ]; then | |
failed_tests+="[charm-local-users](https://github.com/canonical/charm-local-users/actions), " | |
fi | |
if [ "${{ steps.charm-logrotated.outcome }}" != "success" ]; then | |
failed_tests+="[charm-logrotated](https://github.com/canonical/charm-logrotated/actions), " | |
fi | |
if [ "${{ steps.charm-nginx.outcome }}" != "success" ]; then | |
failed_tests+="[charm-nginx](https://github.com/canonical/charm-nginx/actions), " | |
fi | |
if [ "${{ steps.charm-nrpe.outcome }}" != "success" ]; then | |
failed_tests+="[charm-nrpe](https://github.com/canonical/charm-nrpe/actions), " | |
fi | |
if [ "${{ steps.charm-openstack-service-checks.outcome }}" != "success" ]; then | |
failed_tests+="[charm-openstack-service-checks](https://github.com/canonical/charm-openstack-service-checks/actions), " | |
fi | |
if [ "${{ steps.charm-prometheus-blackbox-exporter.outcome }}" != "success" ]; then | |
failed_tests+="[charm-prometheus-blackbox-exporter](https://github.com/canonical/charm-prometheus-blackbox-exporter/actions), " | |
fi | |
# Set the output variable to pass the failed tests to the next job | |
echo "failed_tests=$failed_tests" >> "$GITHUB_OUTPUT" | |
tests-2: | |
name: Run second set of tests | |
runs-on: [self-hosted, small] | |
timeout-minutes: 1440 | |
outputs: | |
failed_tests: ${{ steps.collect-failed-tests.outputs.failed_tests }} | |
steps: | |
- name: Tests for charm-prometheus-libvirt-exporter | |
uses: convictional/[email protected] | |
id: charm-prometheus-libvirt-exporter | |
with: | |
owner: canonical | |
repo: charm-prometheus-libvirt-exporter | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-simple-streams | |
uses: convictional/[email protected] | |
id: charm-simple-streams | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-simple-streams | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charm-storage-connector | |
uses: convictional/[email protected] | |
id: charm-storage-connector | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-storage-connector | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-sysconfig | |
uses: convictional/[email protected] | |
id: charm-sysconfig | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-sysconfig | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for charm-userdir-ldap | |
uses: convictional/[email protected] | |
id: charm-userdir-ldap | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charm-userdir-ldap | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: master | |
wait_interval: 60 | |
- name: Tests for prometheus-hardware-exporter | |
uses: convictional/[email protected] | |
id: prometheus-hardware-exporter | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: prometheus-hardware-exporter | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for prometheus-juju-exporter | |
uses: convictional/[email protected] | |
id: prometheus-juju-exporter | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: prometheus-juju-exporter | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: pr.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for prometheus-juju-backup-all-exporter | |
uses: convictional/[email protected] | |
id: prometheus-juju-backup-all-exporter | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: prometheus-juju-backup-all-exporter | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for snap-tempest | |
uses: convictional/[email protected] | |
id: snap-tempest | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: snap-tempest | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: pr.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Tests for charmed-openstack-upgrader | |
uses: convictional/[email protected] | |
id: charmed-openstack-upgrader | |
if: ${{ always() }} | |
with: | |
owner: canonical | |
repo: charmed-openstack-upgrader | |
github_token: ${{ secrets.GHA_WORKFLOW_TRIGGER }} | |
workflow_file_name: check.yaml | |
ref: main | |
wait_interval: 60 | |
- name: Collect failed tests | |
id: collect-failed-tests | |
if: ${{ failure() }} | |
run: | | |
failed_tests="" | |
if [ "${{ steps.charm-prometheus-libvirt-exporter.outcome }}" != "success" ]; then | |
failed_tests+="[charm-prometheus-libvirt-exporter](https://github.com/canonical/charm-prometheus-libvirt-exporter/actions), " | |
fi | |
if [ "${{ steps.charm-simple-streams.outcome }}" != "success" ]; then | |
failed_tests+="[charm-simple-streams](https://github.com/canonical/charm-simple-streams/actions), " | |
fi | |
if [ "${{ steps.charm-storage-connector.outcome }}" != "success" ]; then | |
failed_tests+="[charm-storage-connector](https://github.com/canonical/charm-storage-connector/actions), " | |
fi | |
if [ "${{ steps.charm-sysconfig.outcome }}" != "success" ]; then | |
failed_tests+="[charm-sysconfig](https://github.com/canonical/charm-sysconfig/actions), " | |
fi | |
if [ "${{ steps.charm-userdir-ldap.outcome }}" != "success" ]; then | |
failed_tests+="[charm-userdir-ldap](https://github.com/canonical/charm-userdir-ldap/actions), " | |
fi | |
if [ "${{ steps.prometheus-hardware-exporter.outcome }}" != "success" ]; then | |
failed_tests+="[prometheus-hardware-exporter](https://github.com/canonical/prometheus-hardware-exporter/actions), " | |
fi | |
if [ "${{ steps.prometheus-juju-exporter.outcome }}" != "success" ]; then | |
failed_tests+="[prometheus-juju-exporter](https://github.com/canonical/prometheus-juju-exporter/actions), " | |
fi | |
if [ "${{ steps.prometheus-juju-backup-all-exporter.outcome }}" != "success" ]; then | |
failed_tests+="[prometheus-juju-backup-all-exporter](https://github.com/canonical/prometheus-juju-backup-all-exporter/actions), " | |
fi | |
if [ "${{ steps.snap-tempest.outcome }}" != "success" ]; then | |
failed_tests+="[snap-tempest](https://github.com/canonical/snap-tempest/actions), " | |
fi | |
if [ "${{ steps.charmed-openstack-upgrader.outcome }}" != "success" ]; then | |
failed_tests+="[charmed-openstack-upgrader](https://github.com/canonical/charmed-openstack-upgrader/actions), " | |
fi | |
# Set the output variable to pass the failed tests to the next job | |
echo "failed_tests=$failed_tests" >> "$GITHUB_OUTPUT" | |
notify-on-failure: | |
needs: [tests-1, tests-2] | |
if: ${{ failure() }} | |
name: Notify Mattermost Channel | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create the Mattermost Message | |
env: | |
FAILED_TESTS_1: ${{ needs.tests-1.outputs.failed_tests }} | |
FAILED_TESTS_2: ${{ needs.tests-2.outputs.failed_tests }} | |
run: | | |
echo "{\"text\":\":robot_face: Weekly tests have failed for these projects: $FAILED_TESTS_1 $FAILED_TESTS_2\"}" > mattermost.json | |
- uses: mattermost/action-mattermost-notify@master | |
env: | |
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} |