ci: automatic security scans #235
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: test | |
on: | |
push: | |
branches: | |
- "main" | |
- "feature/*" | |
- "hotfix/*" | |
- "release/*" | |
- "renovate/*" | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
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/action-conventional-commits@v1.3.0 | |
with: | |
allowed-commit-types: "build,chore,ci,docs,feat,fix,perf,refactor,style,test" | |
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 | |
- 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: | | |
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::Python $python_version (test)" | |
make test-integration | |
echo "::endgroup::" | |
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: results-integration-${{ matrix.python-version }}-${{ matrix.platform }}-${{ matrix.resolution }} | |
path: | | |
./.results.*.xml | |
./.coverage.*.xml |