build: migrate to pyproject.toml #843
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, pull_request, workflow_call] | |
jobs: | |
db-charm-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
charm-repo: | |
# TODO: uncomment once secrets issue is fixed in this charm (see https://github.com/canonical/postgresql-operator/pull/307) | |
# - "canonical/postgresql-operator" | |
- "canonical/postgresql-k8s-operator" | |
# TODO: uncomment once secrets issues are fixed in these charms (eg: https://github.com/canonical/mysql-operator/issues/367) | |
# - "canonical/mysql-operator" | |
# - "canonical/mysql-k8s-operator" | |
steps: | |
- name: Checkout the ${{ matrix.charm-repo }} repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ matrix.charm-repo }} | |
- name: Checkout the operator repository | |
uses: actions/checkout@v3 | |
with: | |
path: myops | |
- name: Install patch dependencies | |
run: pip install poetry~=1.6 | |
- 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 |