Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Add a github actions workflow to run unit tests. #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# main test workflow

name: main

on:
schedule:
- cron: '* * * * 5' # Runs on every Friday.
push:
branches: [ '*', $default-branch ]
tags: ['[0-9]*'] # anything looks like a version.
pull_request:
branches: [ $default-branch ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ 3.9 ]
include:
- {deploy: true, os: ubuntu-latest, python-version: 3.9 }
steps:

- name: Checkout source code
uses: actions/checkout@v2

- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup test env
run: |
python -m pip install tox-gh

- name: Python Unit tests
run: |
tox4

- name: Build Python sdist
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
run: |
python setup.py sdist

# TODO: Release to pypi.
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
if: startsWith(github.ref, 'refs/tags') && matrix.deploy
with:
password: ${{ secrets.PYPI_SECRET }}