From 1bbe64350f7137317f5cae6f8f5c90de27971475 Mon Sep 17 00:00:00 2001 From: Brad Macdonald Date: Mon, 8 Jan 2024 12:53:02 -0700 Subject: [PATCH] adds requirements to testenv --- .github/workflows/ci.yml | 52 +++++++++++++++++++--------------------- tox.ini | 3 ++- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a5a8d3..2aadb09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ concurrency: jobs: prepare: runs-on: ubuntu-latest - # outputs: - # wheel-path: ${{ steps.distribution-paths.outputs.wheel }} - # tarball-path: ${{ steps.distribution-paths.outputs.tarball }} + outputs: + wheel-path: ${{ steps.distribution-paths.outputs.wheel }} + tarball-path: ${{ steps.distribution-paths.outputs.tarball }} steps: - uses: actions/checkout@v3 with: {fetch-depth: 0} # deep clone for setuptools-scm @@ -38,22 +38,22 @@ jobs: run: pipx run pre-commit run --all-files --show-diff-on-failure - name: Install tox-gh plugin run: python -m pip install tox-gh>=1.2 - # - name: Build package distribution files - # run: tox -e clean,build - # - name: Record the paths of wheel and source tarball distributions - # id: distribution-paths - # run: | - # echo "wheel=$(ls dist/*.whl)" >> $GITHUB_OUTPUT - # echo "tarball=$(ls dist/*.tar.gz)" >> $GITHUB_OUTPUT - # - name: Store the distribution files for use in other stages - # # `tests`, `pypi-publish`, and `docker-publish` will use the same - # # pre-built distributions, so we make sure to release the exact - # # same package that was tested - # uses: actions/upload-artifact@v3 - # with: - # name: python-distribution-files - # path: dist/ - # retention-days: 1 + - name: Build package distribution files + run: tox -e clean,build + - name: Record the paths of wheel and source tarball distributions + id: distribution-paths + run: | + echo "wheel=$(ls dist/*.whl)" >> $GITHUB_OUTPUT + echo "tarball=$(ls dist/*.tar.gz)" >> $GITHUB_OUTPUT + - name: Store the distribution files for use in other stages + # `tests`, `pypi-publish`, and `docker-publish` will use the same + # pre-built distributions, so we make sure to release the exact + # same package that was tested + uses: actions/upload-artifact@v3 + with: + name: python-distribution-files + path: dist/ + retention-days: 1 # Prevent scheduled workflow from ever being paused - name: Keepalive Workflow uses: gautamkrishnar/keepalive-workflow@1.1.0 @@ -80,25 +80,21 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - # - uses: actions/download-artifact@v3 - # with: {name: python-distribution-files, path: dist/} + - uses: actions/download-artifact@v3 + with: {name: python-distribution-files, path: dist/} - name: Install tox-gh plugin run: python -m pip install tox-gh>=1.2 - name: Setup test suite run: tox -vv --notest - - name: Install dependencies - run: ./dev_setup.sh ${{ matrix.python }} - - name: activate venv - run: source py-orca-venv-${{ matrix.python }}/bin/activate - name: Run tests env: # New variables should match a `passenv` pattern under `[testenv]` in tox.ini SEVENBRIDGES_CONNECTION_URI: ${{ secrets.SEVENBRIDGES_CONNECTION_URI }} NEXTFLOWTOWER_CONNECTION_URI: ${{ secrets.NEXTFLOWTOWER_CONNECTION_URI }} SYNAPSE_CONNECTION_URI: ${{ secrets.SYNAPSE_CONNECTION_URI }} - run: pytest -vv - # >- - # tox -- -rFEx --durations 10 --color yes + run: >- + tox --installpkg '${{ needs.prepare.outputs.wheel-path }}' + -- -rFEx --durations 10 --color yes - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/tox.ini b/tox.ini index 3cc7633..bc4c28a 100644 --- a/tox.ini +++ b/tox.ini @@ -19,6 +19,8 @@ passenv = HOME *_CONNECTION_URI SETUPTOOLS_* +deps = + -r {toxinidir}/requirements-airflow.txt extras = testing all @@ -48,7 +50,6 @@ skip_install = True changedir = {toxinidir} deps = build: build[virtualenv] - -r {toxinidir}/requirements-airflow.txt passenv = SETUPTOOLS_* commands =