Skip to content

Commit

Permalink
Adds a GitHub Action to test PyPI Releases on a Regular Schedule (#29)
Browse files Browse the repository at this point in the history
* Adds a GitHub Action to test the PyPI releases on a regular schedule

* Splits dependency install between Python 2.7 and 3 to deal with requirements

* Modifies directory structure for testing to ensure pip Hatchet is used

* Updates the pip tester with v2022.2.0

Also adds Python 3.9 to the testing matrix and removes Python 2.7

* For now, only testing v2022.2.0 since it's the only one uploaded to PyPI

* Sets a cron schedule

* Switch back to push trigger for testing

* Removes Python 2.7 dependencies and switches back to cron trigger

* Removes Python 3.5 from matrix

* Run one more test

* Switches back to cron for merge
  • Loading branch information
ilumsden authored Sep 1, 2022
1 parent 46ca330 commit c82e153
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/pip-install-tester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: pip install tester

on:
# Uncomment these lines for testing
# push:
# branches: [ develop ]
# pull_request:
# branches: [ develop, releases/** ]
# Uncomment these lines for production
schedule:
- cron: '0 0 1 JAN,MAY,AUG,NOV *'

jobs:
pip_test:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
hatchet-version: ["2022.2.0"]

steps:
- uses: actions/checkout@v2
with:
ref: ${{ format('v{0}', matrix.hatchet-version) }}

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

- name: Build unit test dependencies
run: |
python -m pip install --upgrade pip pytest
- name: Build Python 3 dependencies
if: ${{ matrix.python-version != 2.7 }}
run: |
python -m pip install tables
- name: Install Hatchet
env:
HATCHET_VERSION: ${{ matrix.hatchet-version }}
run: |
curr_dir=$(pwd)
cd ~
python -m pip install llnl-hatchet==$HATCHET_VERSION
cd $curr_dir
- name: Show packages
run: |
python -m pip list
- name: Prep tests
env:
HATCHET_VERSION: ${{ matrix.hatchet-version }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
cp -r ./hatchet/tests ~
test_dir="tests-$HATCHET_VERSION-$PYTHON_VERSION"
mv ~/tests ~/$test_dir
cat > ~/$test_dir/pytest.ini << EOF
[pytest]
addopts = --durations=20 -ra
testpaths = .
python_files = *.py
EOF
- name: Test Hatchet
env:
HATCHET_VERSION: ${{ matrix.hatchet-version }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
curr_dir=$(pwd)
cd ~
test_dir="tests-$HATCHET_VERSION-$PYTHON_VERSION"
pytest -vv $test_dir
cd $curr_dir

0 comments on commit c82e153

Please sign in to comment.