-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow for running tests in CI
- Loading branch information
1 parent
b49fbb7
commit 847509a
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
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,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 |