Pre-Commit and Cross-Platform Test Suite #69
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: Pre-Commit and Cross-Platform Test Suite | |
on: | |
pull_request: | |
branches: | |
- master | |
types: | |
- opened | |
- synchronize | |
- reopened | |
schedule: | |
# Run every Friday at 23:59 UTC | |
- cron: '59 23 * * 5' | |
workflow_dispatch: | |
jobs: | |
pre-commit: | |
name: Pre-Commit Checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
architecture: 'x64' | |
- name: Pre-Commit | |
run: | | |
python -m pip install pre-commit | |
pre-commit run -a | |
- name: Analysis (git diff) | |
if: failure() | |
run: git diff | |
tests: | |
name: Test-${{ matrix.os }}-Py${{ matrix.python-version }} | |
needs: pre-commit | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: [ '3.8', '3.9'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python-${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Setup Package | |
run: python -m pip install .[dev,test] | |
- name: Unit Tests | |
run: py.test -v |