Skip to content

Commit

Permalink
ci: Update CI to run triggers
Browse files Browse the repository at this point in the history
* Add pull request, schedule, and workflow dispatch triggers for CI.
* Add concurrency limits.
* Use pytest CLI API.
* Remove environment settings that aren't used.
  • Loading branch information
matthewfeickert committed Jun 24, 2024
1 parent 329d601 commit aadcba1
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions .github/workflows/test-energyflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ name: Tests
on:
push:
branches:
- master
- master
pull_request:
branches:
- master
# Run weekly at 1:23 UTC
schedule:
- cron: '23 1 * * 0'
workflow_dispatch:

env:
PYPI: 0
PYPITEST: 1
TWINE_USERNAME: __token__
TWINE_PASSWORD_PYPITEST: ${{ secrets.TWINE_PASSWORD_PYPITEST }}
TWINE_PASSWORD_PYPI: ${{ secrets.TWINE_PASSWORD_PYPI }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -25,15 +29,19 @@ jobs:
uses: actions/checkout@v3
with:
submodules: recursive

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

- name: Display Python version
run: python --version

- name: Install test prerequisites
run: |
pip install cython
pip install .[tests]
python -m pip install cython
python -m pip install '.[tests]'
- name: Run tests
run: python setup.py test -v
run: pytest --verbose tests

0 comments on commit aadcba1

Please sign in to comment.