Skip to content

Update Python dependencies (8-transition/edge) #3622

Update Python dependencies (8-transition/edge)

Update Python dependencies (8-transition/edge) #3622

Workflow file for this run

name: Run tests
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
on:
pull_request:
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.12"
cache: "poetry"
- name: Install deps
run: |
sudo apt update
sudo apt install -y build-essential python3-dev libldap-dev libsasl2-dev
- 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
check-pyproject-dynamic-versioning:
name: Poetry dynamic versioning check
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install deps
run: sudo snap install yq
- name: Check versioning
run: |
VERSION=$(yq -p toml -oy '.tool.poetry.version' ./pyproject.toml)
DYNAMIC_FIELDS=$(yq -p toml -oc '.project.dynamic' ./pyproject.toml)
if [[ $VERSION != *"0.0.0"* ]]
then
exit 1
fi
if [[ $DYNAMIC_FIELDS != *"version"* ]]
then
exit 1
fi
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
lib-check:
name: Check libraries
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/check-libraries@2.7.0
continue-on-error: true
with:
charm-path: ./single_kernel_mongo/
credentials: ${{ secrets.CHARMHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
permissions:
pull-requests: write
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: Set up python environment
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "poetry"
- name: Install deps
run: |
sudo apt update
sudo apt install -y build-essential python3-dev libldap-dev libsasl2-dev
- name: Run linters
run: tox run -e lint
unit-test:
strategy:
matrix:
env:
- lxd
- microk8s
name: Unit test charm (${{ matrix.env }})
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.12"
cache: "poetry"
- name: Install deps
run: |
sudo apt update
sudo apt install -y build-essential python3-dev libldap-dev libsasl2-dev
- name: Run tests
run: tox run -e unit-${{ matrix.env }}
build:
strategy:
matrix:
path:
- tests/charms/mongodb_test_charm
- tests/charms/mongodb_k8s_test_charm
- tests/charms/mongos_test_charm
- tests/charms/mongos_k8s_test_charm
name: Build Test charm | ${{ matrix.path }}
uses: ./.github/workflows/build_test_charms.yaml
with:
path-to-charm-directory: ${{ matrix.path }}
artifact-prefix: packed-charm
cache: true
build-helpers:
strategy:
matrix:
path:
- tests/integration/applications/client_relations_charm
- tests/integration/applications/continuous_write_charm
- tests/integration/applications/mongos_client_charm
name: Build charm | ${{ matrix.path }}
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v40.0.2
with:
path-to-charm-directory: ${{ matrix.path }}
artifact-prefix: packed-charm
cache: true
integration-test:
name: Integration test charm
needs:
- tox-lint
- unit-test
- build
- build-helpers
uses: ./.github/workflows/integration_test.yaml
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
secrets: inherit
permissions:
contents: write # Needed for Allure Report