Skip to content

Commit

Permalink
ci: handle presence/absence of "static" and "static-charm" envs (#1590)
Browse files Browse the repository at this point in the history
The observability charms we test against now have a mixture of
environment names, so check whether each is present before trying to run
them.
  • Loading branch information
tonyandrewmeyer authored Feb 27, 2025
1 parent b1b375e commit 8fe590a
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .github/workflows/observability-charm-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,43 @@ jobs:
if: ${{ !(matrix.disabled) }}
run: tox -vve unit

- name: Check if 'scenario' tox environment exists
id: check-tox-env-scenario
run: |
if tox --listenvs | grep -q "^scenario$"; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
# alertmanager-k8s has old Scenario tests, so we can't do this until those
# are updated.
# - name: Run the charm's scenario unit tests
# if: ${{ steps.check-tox-env-scenario.outputs.exists == 'true' && !(matrix.disabled) }}
# run: tox -vve scenario

- name: Check if 'static' tox environment exists
id: check-tox-env-static
run: |
if tox --listenvs | grep -q "^static$"; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Run the charm's static analysis checks
if: ${{ !(matrix.disabled) }}
if: ${{ steps.check-tox-env-static.outputs.exists == 'true' && !(matrix.disabled) }}
run: tox -vve static

- name: Check if 'static-charm' tox environment exists
id: check-tox-env-static-charm
run: |
if tox --listenvs | grep -q "^static-charm$"; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Run the charm's static (charm) analysis checks
if: ${{ steps.check-tox-env-static-charm.outputs.exists == 'true' && !(matrix.disabled) }}
run: tox -vve static-charm

0 comments on commit 8fe590a

Please sign in to comment.