Skip to content

Commit

Permalink
Add GitHub Actions workflow for running tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Dec 16, 2021
1 parent b49fbb7 commit 847509a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
File renamed without changes.
55 changes: 55 additions & 0 deletions .github/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Run the project's test suite
name: Tests

on:
push:
branches:
- master
- main
- '*.x'
pull_request:
branches:
- master
- main
- '*.x'

jobs:
test:
name: Test Python ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.6', '3.9']
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Print basic Python info
shell: python
run: |
import sys
print(sys.executable, sys.version, sep='\n')
- name: Install baseline deps
run: python -m pip install --upgrade pip setuptools wheel
- name: Install build deps
run: python -m pip install --upgrade --upgrade-strategy eager build setuptools twine wheel
- name: Build package
run: python -bb -X dev -W error -m build
- name: Install wheel
shell: bash
run: 'echo dist/*.whl | xargs -I % python -bb -X dev -W error -m pip install --upgrade %[test]'
- name: Run tests
shell: bash
run: |
mkdir -p temp_test_dir # To avoid picking up local copy due to lack of src dir layout
cd temp_test_dir
python -I -bb -X dev -W error -m pytest
- name: Twine check
run: twine check --strict dist/*
- name: Pip check
run: pip check -v

0 comments on commit 847509a

Please sign in to comment.