-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
separate tox testenvs to cache CRDS reference files retrieved by initial test #7323
Changes from all commits
752620e
1a230a9
9bca5be
9aaf5a0
5e51b43
ed8aeee
f30c7b7
cee87d6
0cccaaa
800ed16
f660d92
790e04c
0d53fcf
91d9fec
1da95ad
4d13fb4
310b9c0
f8791fd
a88e1ba
26e0464
94d80d6
dd54c22
63cdbb3
8edcd82
f1e5f98
208dbe7
045e5bd
0380292
4f6569f
dc8c61f
40b7843
2f921f5
f77fc21
bd23c6c
1b703b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,86 +19,160 @@ env: | |
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 | ||
|
||
jobs: | ||
tox: | ||
check: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toxenv: [ check-style, check-security, check-install ] | ||
python-version: [ '3.x' ] | ||
os: [ ubuntu-latest ] | ||
include: | ||
- name: Python 3.10 Tests | ||
python-version: '3.10' | ||
os: ubuntu-latest | ||
toxenv: py310 | ||
|
||
- name: Latest dependency versions w/coverage | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: py39-cov | ||
|
||
- name: Oldest dependency versions | ||
os: ubuntu-latest | ||
python-version: 3.8 | ||
toxenv: py38-oldestdeps-cov | ||
|
||
- name: SDP dependencies in requirements-sdp.txt | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: sdpdeps | ||
|
||
- name: Installed package with --pyargs | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: pyargs | ||
|
||
- name: Verify install_requires in setup.py | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: verify-install-requires | ||
|
||
- name: Build distribution | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: twine | ||
|
||
- name: Code style check | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: style | ||
|
||
toxenv: check-style | ||
- name: Security audit | ||
os: ubuntu-latest | ||
python-version: 3.9 | ||
toxenv: security | ||
|
||
# MacOS job is flaky on Github actions and fails routinely. | ||
# Re-enable when things get more reliable. | ||
# - name: macOS | ||
# os: macos-latest | ||
# python-version: 3.9 | ||
# toxenv: py39 | ||
toxenv: check-security | ||
- name: Verify install_requires in setup.py | ||
toxenv: check-install | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install tox | ||
run: | | ||
pip install tox | ||
|
||
- name: Run tests | ||
run: tox -e ${{ matrix.toxenv }} | ||
|
||
- name: Upload coverage to codecov | ||
if: ${{ contains(matrix.toxenv,'-cov') }} | ||
- run: pip install tox | ||
- run: tox -e ${{ matrix.toxenv }} | ||
quick_test: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the sole purpose of this quick_test to generate a cache that the other tests can use? |
||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ check ] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
toxenv: [ test-xdist ] | ||
python-version: [ '3.x' ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install tox | ||
- run: tox -e ${{ matrix.toxenv }} | ||
- run: echo "REFERENCE_FILES_HASH=${{ hashFiles(format('{0}/references/*', env.CRDS_PATH)) }}" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CRDS_PATH }} | ||
key: crds-reference-files-${{ env.REFERENCE_FILES_HASH }} | ||
- run: echo ${{ env.REFERENCE_FILES_HASH }} > reference_files_hash.txt | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: reference_files_hash | ||
path: reference_files_hash.txt | ||
test: | ||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ quick_test ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since these tests don't even kick off until |
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toxenv: [ test-xdist, test-oldestdeps, test-sdpdeps-xdist ] | ||
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | ||
os: [ ubuntu-latest, macos-latest ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I don't think we should be running on macos. The runners are too slow, and they don't test anything extra compared to the linux runners. If our test suite was 3 minutes, fine. But it is over an hour on the macos runners. Likewise, oldestdeps probably only needs to run on the oldest supported version of python (and in fact probably only can), and the sdpdeps probably only should run on whatever version of python DMS/SDP is currently using, python 3.9 currently, i.e. whatever our JenkinsfileRT says. |
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install tox | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: reference_files_hash | ||
- run: echo "REFERENCE_FILES_HASH=$(cat reference_files_hash.txt)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CRDS_PATH }} | ||
key: crds-reference-files-${{ env.REFERENCE_FILES_HASH }} | ||
- run: tox -e ${{ matrix.toxenv }} | ||
test_pyargs: | ||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ test ] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
toxenv: [ test-pyargs-xdist ] | ||
python-version: [ '3.x' ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install tox | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: reference_files_hash | ||
- run: echo "REFERENCE_FILES_HASH=$(cat reference_files_hash.txt)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CRDS_PATH }} | ||
key: crds-reference-files-${{ env.REFERENCE_FILES_HASH }} | ||
- run: tox -e ${{ matrix.toxenv }} | ||
test_with_coverage: | ||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ test ] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toxenv: [ test-cov ] | ||
python-version: [ '3.x' ] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install tox | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: reference_files_hash | ||
- run: echo "REFERENCE_FILES_HASH=$(cat reference_files_hash.txt)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.CRDS_PATH }} | ||
key: crds-reference-files-${{ env.REFERENCE_FILES_HASH }} | ||
- run: tox -e ${{ matrix.toxenv }} | ||
- if: ${{ contains(matrix.toxenv,'-cov') }} | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.xml | ||
flags: unit | ||
fail_ci_if_error: true | ||
build: | ||
name: ${{ matrix.toxenv }} (Python ${{ matrix.python-version }}, ${{ matrix.os }}) | ||
needs: [ test ] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
toxenv: [ build-twine ] | ||
python-version: [ '3.8', '3.9', '3.10', '3.11' ] | ||
os: [ ubuntu-latest, macos-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: pip install tox | ||
- run: tox -e ${{ matrix.toxenv }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
|
||
env: | ||
CRDS_SERVER_URL: https://jwst-crds.stsci.edu | ||
CRDS_PATH: ~/crds_cache | ||
CRDS_PATH: $HOME/crds_cache | ||
CRDS_CLIENT_RETRY_COUNT: 3 | ||
CRDS_CLIENT_RETRY_DELAY_SECONDS: 20 | ||
|
||
|
@@ -25,32 +25,13 @@ jobs: | |
python-version: 3.9 | ||
toxenv: devdeps | ||
steps: | ||
- name: Install system packages | ||
if: ${{ contains(matrix.toxenv,'docs') }} | ||
run: | | ||
sudo apt-get install graphviz texlive-latex-extra dvipng | ||
|
||
- name: Checkout the code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install tox | ||
run: | | ||
pip install tox | ||
|
||
- name: Run tests | ||
run: tox -e ${{ matrix.toxenv }} | ||
|
||
- name: Upload coverage to codecov | ||
if: ${{ contains(matrix.toxenv,'-cov') }} | ||
uses: codecov/codecov-action@v3 | ||
Comment on lines
-50
to
-52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing coverage reporting here is probably a good idea since nothing is changing on |
||
- run: pip install tox | ||
- uses: actions/cache@v3 | ||
with: | ||
file: ./coverage.xml | ||
flags: unit | ||
fail_ci_if_error: true | ||
path: ${{ env.CRDS_PATH }} | ||
key: crds-reference-files-${{ hashFiles(format('{0}/references/*', env.CRDS_PATH)) }} | ||
- run: tox -e ${{ matrix.toxenv }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These and the other 2 are already in the matrix above. Probably no need to add them here.