-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
80 additions
and
0 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,78 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- "src/pytregex/**" | ||
- "tests/**" | ||
- ".github/workflows/python-package.yml" | ||
pull_request: | ||
paths: | ||
- "src/pytregex/**" | ||
- "tests/**" | ||
- ".github/workflows/python-package.yml" | ||
schedule: | ||
- cron: '0 10 * * *' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | ||
os: [ubuntu-latest, macos-latest, macos-13, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# This is necessary to get the PR head instead of base | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies on macOS and Linux | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
python -m pip install --upgrade pip | ||
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
shell: bash | ||
- name: Install dependencies on Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
python -m pip install --upgrade pip | ||
if (Test-Path -Path '.\requirements-dev.txt' -PathType Leaf) {pip install --upgrade -r requirements-dev.txt} | ||
if (Test-Path -Path '.\requirements.txt' -PathType Leaf) {pip install --upgrade -r requirements.txt} | ||
shell: pwsh | ||
- name: Build dist and test with unittest on macOS and Linux | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
python -m build | ||
pip install dist/*.whl | ||
python -m unittest | ||
- name: Build dist and test with unittest on Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
python -m build | ||
pip install (Get-ChildItem dist/*.whl) | ||
python -m unittest | ||
shell: pwsh | ||
- name: Generate coverage report | ||
run: | | ||
coverage run --source pytregex --parallel-mode -m unittest | ||
coverage combine | ||
coverage xml -i | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
setuptools | ||
wheel | ||
twine | ||
build | ||
|
||
# Lint & Coverage | ||
black | ||
|