From aadcba1b3c6919b20978e5e2c3cbe6095b70b1ba Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Mon, 24 Jun 2024 11:16:23 -0500 Subject: [PATCH] ci: Update CI to run triggers * Add pull request, schedule, and workflow dispatch triggers for CI. * Add concurrency limits. * Use pytest CLI API. * Remove environment settings that aren't used. --- .github/workflows/test-energyflow.yml | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-energyflow.yml b/.github/workflows/test-energyflow.yml index 3db2100..9337e25 100644 --- a/.github/workflows/test-energyflow.yml +++ b/.github/workflows/test-energyflow.yml @@ -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: @@ -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