-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also adjusts the tox file and the github workflows
- Loading branch information
Showing
7 changed files
with
2,064 additions
and
165 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
- [ ] Have you followed the guidelines for contributing? | ||
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? | ||
- [ ] Have you successfully run `tox`? | ||
- [ ] Have you successfully run `make lint && make 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
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 |
---|---|---|
|
@@ -17,105 +17,126 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install tools | ||
run: | | ||
make setup | ||
- name: Run Linters | ||
run: | | ||
make -k lint | ||
- name: conventional commits | ||
uses: webiny/[email protected] | ||
with: | ||
allowed-commit-types: "build,chore,ci,docs,feat,fix,perf,refactor,style,test" | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Configure environment | ||
run: | | ||
echo "::group::Begin snap install" | ||
echo "Installing snaps in the background while running apt and pip..." | ||
sudo snap install --no-wait --classic pyright | ||
sudo snap install --no-wait codespell shellcheck ruff | ||
echo "::endgroup::" | ||
echo "::group::pip install" | ||
python -m pip install tox | ||
echo "::endgroup::" | ||
echo "::group::Create virtual environments for linting processes." | ||
tox run --colored yes -m lint --notest | ||
echo "::endgroup::" | ||
echo "::group::Wait for snap to complete" | ||
snap watch --last=install | ||
echo "::endgroup::" | ||
- name: Run Linters | ||
run: tox run --skip-pkg-install --no-list-dependencies --colored yes -m lint | ||
unit: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest] | ||
resolution: [highest] | ||
include: | ||
- platform: ubuntu-latest | ||
resolution: lowest | ||
runs-on: ${{ matrix.platform }} | ||
env: | ||
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv | ||
steps: | ||
- uses: actions/cache@v4 | ||
id: cache-uv | ||
with: | ||
path: ${{ env.UV_CACHE_DIR }} | ||
key: ${{ matrix.platform }}-uv-${{ matrix.resolution }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install tools | ||
shell: bash | ||
run: | | ||
make setup | ||
- name: Set up Python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: | | ||
3.10 | ||
3.11 | ||
3.12 | ||
3.13-dev | ||
cache: 'pip' | ||
- name: Configure environment | ||
- name: Configure venv and test | ||
shell: bash | ||
run: | | ||
echo "::group::pip install" | ||
python -m pip install tox | ||
echo "::endgroup::" | ||
mkdir -p results | ||
- name: Setup Tox environments | ||
run: tox run --colored yes -m tests --notest | ||
- name: Test with tox | ||
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m unit-tests | ||
for python_version in 3.10 3.11 3.12 3.13; do | ||
echo "::group::Python $python_version (install)" | ||
uv sync --python=$python_version --reinstall --resolution=${{ matrix.resolution }} | ||
echo "::endgroup::" | ||
echo "::group::Python $python_version (test)" | ||
make test-unit | ||
echo "::endgroup::" | ||
done | ||
env: | ||
PYTEST_ADDOPTS: "--no-header -vv -rN" | ||
- name: Upload code coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./results/ | ||
files: coverage*.xml | ||
name: coverage-unit-${{ matrix.python-version }}-${{ matrix.platform }} | ||
files: .coverage*.xml | ||
- name: Upload test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: unit-test-results-${{ matrix.platform }} | ||
path: results/ | ||
name: results-unit-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.resolution }} | ||
path: | | ||
./.results.*.xml | ||
./.coverage.*.xml | ||
integration: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-latest, macos-latest] | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
resolution: [highest] | ||
include: | ||
- platform: ubuntu-latest | ||
resolution: lowest | ||
runs-on: ${{ matrix.platform }} | ||
env: | ||
UV_CACHE_DIR: ${{ github.workspace }}/.cache/uv | ||
steps: | ||
- uses: actions/cache@v4 | ||
id: cache-uv | ||
with: | ||
path: ${{ env.UV_CACHE_DIR }} | ||
key: ${{ matrix.platform }}-uv-${{ matrix.resolution }} | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install tools | ||
shell: bash | ||
run: | | ||
make setup | ||
- name: Set up Python | ||
if: ${{ runner.os != 'Linux' }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: | | ||
3.10 | ||
3.12 | ||
3.13-dev | ||
cache: 'pip' | ||
- name: Configure environment | ||
python-version: "3.10" | ||
- name: Configure venv and test | ||
shell: bash | ||
run: | | ||
echo "::group::pip install" | ||
python -m pip install tox | ||
echo "::group::Sync" | ||
uv sync --reinstall --resolution=${{ matrix.resolution }} | ||
echo "::endgroup::" | ||
echo "::group::Test" | ||
make test-integration | ||
echo "::endgroup::" | ||
mkdir -p results | ||
- name: Setup Tox environments | ||
run: tox run --colored yes -m tests --notest | ||
- name: Test with tox | ||
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m integration-tests | ||
env: | ||
PYTEST_ADDOPTS: "--no-header -vv -rN" | ||
- name: Upload code coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: coverage-integration-${{ matrix.python-version }}-${{ matrix.platform }} | ||
files: .coverage*.xml | ||
- name: Upload test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: integration-test-results-${{ matrix.platform }} | ||
path: results/ | ||
name: results-integration-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.resolution }} | ||
path: | | ||
./.results.*.xml | ||
./.coverage.*.xml |
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
Oops, something went wrong.