-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
325 additions
and
41 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Lint | ||
on: | ||
workflow_call: | ||
# Because we have a uv.lock file, we can also use this workflow to lint ourselves. | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Begin snap installs of common linters | ||
id: snap-install | ||
run: | | ||
echo -n 'jobs="$(sudo snap install --no-wait codespell ruff shellcheck)"' >> $GITHUB_OUTPUT | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Set up linters | ||
run: | | ||
for job in ${{ steps.snap-install.jobs }}; do | ||
sudo snap watch $job | ||
done | ||
make setup-lint | ||
- name: Run linters | ||
run: make -k lint |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Check policy | ||
on: | ||
workflow_call: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
cla: | ||
name: Authors signed Canonical CLA | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if CLA signed | ||
uses: canonical/has-signed-canonical-cla@v1 | ||
commits: | ||
name: Conventional Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: webiny/[email protected] | ||
with: | ||
allowed-commit-types: "build,chore,ci,docs,feat,fix,perf,refactor,style,test" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: QA self-test | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
lint-python: | ||
uses: ./.github/workflows/lint-python.yaml | ||
test-python: | ||
uses: ./.github/workflows/test-python.yaml | ||
test-python-custom: | ||
uses: ./.github/workflows/test-python.yaml | ||
with: | ||
unit-platforms: '["ubuntu-latest"]' | ||
unit-python-versions: '["3.14"]' | ||
integration-platforms: '["ubuntu-latest"]' | ||
integration-python-versions: '["3.14"]' | ||
lowest-python-version: '["3.0"]' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
name: Test Python | ||
on: | ||
workflow_call: | ||
inputs: | ||
unit-platforms: | ||
required: false | ||
type: string | ||
default: '["ubuntu-22.04", "ubuntu-24.04", "windows-latest", "macos-latest"]' | ||
description: | | ||
The platforms to run unit tests on, as a JSON array. | ||
unit-python-versions: | ||
required: false | ||
type: string | ||
default: '["3.10", "3.11", "3.12", "3.13"]' | ||
description: | | ||
The python versions to run unit tests on, as a JSON array. | ||
lowest-python-version: | ||
required: false | ||
type: string | ||
description: | | ||
The Python version to run when using "lowest" resolution for unit tests. | ||
integration-platforms: | ||
type: string | ||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]' | ||
description: | | ||
The platforms to run integration tests on, as a JSON array. | ||
integration-python-versions: | ||
required: false | ||
type: string | ||
default: '["3.10"]' | ||
description: | | ||
The python versions to run integration tests on, as a JSON array. | ||
jobs: | ||
unit: | ||
strategy: | ||
matrix: | ||
platform: ${{ fromJson(inputs.unit-platforms) }} | ||
python-version: ${{ fromJson(inputs.unit-python-versions) }} | ||
runs-on: ${{ matrix.platform }} | ||
env: | ||
UV_PYTHON: ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-suffix: ${{ matrix.platform }} | ||
- name: Set up tests | ||
run: make setup-tests | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
make coverage | ||
- name: Upload coverage | ||
if: ${{ inputs.target == 'coverage' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-${{ matrix.platform }}-${{ matrix.python-version }} | ||
overwrite: true | ||
path: | | ||
./coverage.xml | ||
htmlcov/** | ||
- name: Run TICS analysis | ||
uses: tiobe/tics-github-action@v3 | ||
if: ${{ runner.os == 'Linux' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/tics') }} | ||
with: | ||
mode: qserver | ||
project: ${{ github.repository }} | ||
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default | ||
branchdir: ${{ github.workspace }} | ||
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }} | ||
installTics: true | ||
unit-lowest: | ||
name: unit (minimum deps) | ||
if: ${{ inputs.lowest-python-version }} != '' | ||
runs-on: ubuntu-20.04 | ||
env: | ||
UV_PYTHON: ${{ inputs.lowest-python-version }} | ||
UV_RESOLUTION: lowest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-suffix: ${{ matrix.platform }} | ||
- name: Install tools | ||
run: | | ||
make setup-tests | ||
- name: Run unit tests | ||
run: | | ||
make coverage | ||
integration: | ||
strategy: | ||
matrix: | ||
platform: ${{ fromJson(inputs.integration-platforms) }} | ||
python-version: ${{ fromJson(inputs.integration-python-versions) }} | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-suffix: ${{ matrix.platform }} | ||
- name: Install tools | ||
run: | | ||
make setup-tests | ||
- name: Integration tests | ||
run: | | ||
make test-integration | ||
env: | ||
PYTEST_ADDOPTS: "--no-header -v -rN" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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