fix: catch post upgrade check errors #649
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: Run tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- feat/** | |
schedule: | |
- cron: "53 0 * * *" # Daily at 00:53 UTC | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
pre-commit: | |
name: Run pre-commits | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install tox & poetry | |
run: | | |
pipx install tox poetry | |
- name: Set up python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: 'poetry' | |
- name: Install pre-commit | |
run: | | |
poetry install | |
poetry run pre-commit install | |
- name: Run pre-commit hooks | |
run: | | |
poetry run pre-commit run --all-files | |
actionlint: | |
name: Lint .github/workflows/ | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install actionlint | |
id: install | |
run: | | |
curl -O https://raw.githubusercontent.com/rhysd/actionlint/main/.github/actionlint-matcher.json | |
echo "::add-matcher::actionlint-matcher.json" | |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) | |
- name: Run actionlint | |
run: | | |
'${{ steps.install.outputs.executable }}' -color | |
tox-lint: | |
name: tox run -e lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install tox & poetry | |
run: | | |
pipx install tox poetry | |
- name: Run linters | |
run: tox run -e lint | |
unit-test: | |
name: Unit test charm | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Install tox & poetry | |
run: | | |
pipx install tox poetry | |
- name: Set up python environment | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: 'poetry' | |
- name: Run tests | |
run: tox run -e unit |