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: Beta build | |
on: | |
push: | |
branches: | |
- 'beta/**' | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
env: | |
PACKAGE: mono2repo | |
PYTHONPATH: src | |
GITHUB_DUMP: ${{ toJson(github) }} | |
XPY: "3.12" | |
XOS: "ubuntu-latest" | |
VERSIONFILE: src/mono2repo/mono2repo.py | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: "Dump env" | |
shell: bash | |
run: | | |
echo "github env:" | |
echo "$GITHUB_DUMP" | |
- name: "Checkout" | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.push.ref }} | |
- name: "Setup Python toolchain" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: "Setup Python dependencies" | |
shell: bash | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools setuptools-github build wheel twine | |
pip install -r tests/requirements.txt | |
- name: "Run Python checks (ruff)" | |
shell: bash | |
run: | | |
ruff check src tests | |
- name: "Run Python checks (mypy)" | |
shell: bash | |
env: | |
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}} | |
run: | | |
mypy src \ | |
--no-incremental --xslt-html-report $OUTDIR/mypy | |
- name: "Run Python checks (pytests)" | |
shell: bash | |
env: | |
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}} | |
run: | | |
py.test \ | |
--cov=${{ env.PACKAGE }} \ | |
--cov-report=html:$OUTDIR/coverage --cov-report=xml:$OUTDIR/coverage.xml \ | |
--junitxml=$OUTDIR/junit/junit.xml --html=$OUTDIR/junit/junit.html --self-contained-html \ | |
tests | |
- name: "Build wheel packages" | |
if: ${{ ! contains(matrix.os, 'windows') }} | |
run: | | |
python support/release.py $VERSIONFILE | |
touch .keepme | |
- name: "Upload pytest test results" | |
uses: actions/upload-artifact@v4 | |
env: | |
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}} | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: $OUTDIR | |
# Use always() to always run this step to publish test results when there are test failures | |
if: always() | |
- name: "Upload coverage to Codecov" | |
uses: codecov/codecov-action@v2 | |
env: | |
OUTDIR: build/qa-${{ matrix.python-version }}-${{ matrix.os}} | |
if: ${{ (matrix.python-version == env.XPY) && (matrix.os == env.XOS) }} | |
with: | |
fail_ci_if_error: true | |
files: $OUTDIR/coverage.xml | |
- name: "Upload beta package to pypi" | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ (matrix.python-version == env.XPY) && (matrix.os == env.XOS) }} | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |