-
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.
chore: merge remote-tracking branch 'starbase/work/use-uv' into work/…
…use-uv
- Loading branch information
Showing
21 changed files
with
2,960 additions
and
210 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
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 |
---|---|---|
@@ -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
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 |
---|---|---|
@@ -1,78 +1,142 @@ | ||
name: Tests, linting, etc. | ||
name: test | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "feature/*" | ||
- "hotfix/*" | ||
- "release/*" | ||
- "renovate/*" | ||
pull_request: | ||
|
||
jobs: | ||
linters: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Configure environment | ||
- name: Install tools | ||
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 shellcheck | ||
echo "::endgroup::" | ||
echo "::group::pip install" | ||
python -m pip install 'tox>=4' tox-gh | ||
echo "::endgroup::" | ||
echo "::group::Create virtual environments for linting processes." | ||
tox run -m lint --notest | ||
echo "::endgroup::" | ||
echo "::group::Wait for snap to complete" | ||
snap watch --last=install | ||
echo "::endgroup::" | ||
make setup | ||
- name: Run Linters | ||
run: tox run -m lint | ||
tests: | ||
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" | ||
unit: | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-20.04, ubuntu-22.04] | ||
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: Set up Python versions on ${{ matrix.platform }} | ||
uses: actions/setup-python@v4 | ||
- 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 | ||
- name: Configure environment | ||
- name: Configure venv and test | ||
shell: bash | ||
run: | | ||
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: | ||
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: results-unit-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.resolution }} | ||
path: | | ||
./.results.*.xml | ||
./.coverage.*.xml | ||
integration: | ||
strategy: | ||
matrix: | ||
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: | | ||
echo "::group::pip install" | ||
python -m pip install 'tox>=4' tox-gh | ||
make setup | ||
- name: Set up Python | ||
if: ${{ runner.os != 'Linux' }} | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Configure venv and test | ||
shell: bash | ||
run: | | ||
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 -m tests --notest | ||
- name: Test with tox | ||
run: tox run-parallel --parallel all --parallel-no-spinner --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -m tests -- --no-header --quiet -rN | ||
env: | ||
PYTEST_ADDOPTS: "--no-header -vv -rN" | ||
- name: Upload code coverage | ||
uses: codecov/codecov-action@v3 | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
directory: ./results/ | ||
files: coverage*.xml | ||
name: coverage-integration-${{ matrix.python-version }}-${{ matrix.platform }} | ||
files: .coverage*.xml | ||
- name: Upload test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 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
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.