Skip to content

Commit

Permalink
TST: Add GH actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Jun 28, 2022
1 parent 3dd78f6 commit c8ee009
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: install-test

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
schedule:
# 7am EST / 8am EDT Mondays
- cron: '0 12 * * 1'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10]
install: [repo]
pip-flags: ['', '--pre']
include:
- python-version: 3.9
install: sdist
pip-flags: ''
- python-version: 3.9
install: wheel
pip-flags: ''
- python-version: 3.9
install: editable
pip-flags: ''

env:
INSTALL_TYPE: ${{ matrix.install }}
PIP_FLAGS: ${{ matrix.pip-flags }}

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Select archive
run: |
if [ "$INSTALL_TYPE" = "sdist" ]; then
ARCHIVE=$( ls dist/*.tar.gz )
elif [ "$INSTALL_TYPE" = "wheel" ]; then
ARCHIVE=$( ls dist/*.whl )
elif [ "$INSTALL_TYPE" = "repo" ]; then
ARCHIVE="."
elif [ "$INSTALL_TYPE" = "editable" ]; then
ARCHIVE="-e ."
fi
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV
- name: Install package and test dependencies
run: python -m pip install $PIP_FLAGS $ARCHIVE[test]
- name: Run tests
run: python -m pytest -sv --doctest-modules etelemetry

0 comments on commit c8ee009

Please sign in to comment.