Skip to content

Commit 1f4e665

Browse files
authored
Merge pull request #2378 from bsipocz/CI_restructure_dev_test
MNT: Adding more dev dependency testing
2 parents c2bfa20 + 0b11785 commit 1f4e665

File tree

4 files changed

+112
-33
lines changed

4 files changed

+112
-33
lines changed

.github/workflows/ci_crontests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI-crontests
2+
3+
on:
4+
push:
5+
# Run this job on release tags, but not on pushes to the main branch
6+
tags:
7+
- '*'
8+
schedule:
9+
# run every Monday at 5am UTC
10+
- cron: '0 5 * * 1'
11+
12+
jobs:
13+
tests:
14+
name: ${{ matrix.name }}
15+
runs-on: ${{ matrix.os }}
16+
if: github.event_name == 'schedule' && github.repository == 'astropy/astroquery'
17+
strategy:
18+
fail-fast: true
19+
matrix:
20+
include:
21+
- name: Python 3.8 with all dependencies with remote data
22+
os: ubuntu-latest
23+
python: '3.8'
24+
toxenv: py38-test-alldeps-devdeps
25+
toxargs: -v
26+
toxposargs: --remote-data
27+
28+
- name: pre-repease dependencies with all dependencies
29+
os: ubuntu-latest
30+
python: '3.10'
31+
toxenv: py310-test-alldeps-predeps
32+
toxargs: -v
33+
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v2
37+
with:
38+
fetch-depth: 0
39+
- name: Set up Python
40+
uses: actions/setup-python@v2
41+
with:
42+
python-version: ${{ matrix.python }}
43+
- name: Install Python dependencies
44+
run: python -m pip install --upgrade tox
45+
- name: Run tests
46+
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}

.github/workflows/ci_devtests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This test job is separated out into its own workflow to be able to obtain a separate badge for it
2+
name: CI-devtest
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- '*'
10+
pull_request:
11+
branches:
12+
- main
13+
schedule:
14+
# run every Monday at 5am UTC
15+
- cron: '0 5 * * 1'
16+
17+
jobs:
18+
tests:
19+
name: ${{ matrix.name }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
include:
25+
- name: dev dependencies with all dependencies with coverage
26+
os: ubuntu-latest
27+
python: '3.10'
28+
toxenv: py310-test-alldeps-devdeps-cov
29+
toxargs: -v
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
36+
- name: Set up Python
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: ${{ matrix.python }}
40+
- name: Install Python dependencies
41+
run: python -m pip install --upgrade tox
42+
- name: Run tests
43+
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
44+
- name: Upload coverage to codecov
45+
if: contains(matrix.toxenv,'-cov')
46+
uses: codecov/codecov-action@v2
47+
with:
48+
file: ./coverage.xml

.github/workflows/ci_tests.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Developer version testing as well as cron testings are in separate workflows
12
name: CI
23

34
on:
@@ -33,12 +34,6 @@ jobs:
3334
toxenv: py37-test-oldestdeps
3435
toxargs: -v
3536

36-
- name: astropy dev with all dependencies with coverage
37-
os: ubuntu-latest
38-
python: '3.10'
39-
toxenv: py310-test-alldeps-devastropy-cov
40-
toxargs: -v
41-
4237
- name: Python 3.8 with all optional dependencies (MacOS X)
4338
os: macos-latest
4439
python: 3.8
@@ -70,27 +65,6 @@ jobs:
7065
with:
7166
file: ./coverage.xml
7267

73-
# This needs to be outside of matrix because if is not supported
74-
# for only one job in a matrix. But once that is supported, this can go
75-
# back to the matrix above.
76-
remote_data:
77-
name: Python 3.8 with all dependencies with remote data
78-
if: github.event_name == 'schedule' && github.repository == 'astropy/astroquery'
79-
runs-on: ubuntu-latest
80-
steps:
81-
- name: Checkout code
82-
uses: actions/checkout@v2
83-
with:
84-
fetch-depth: 0
85-
- name: Set up Python
86-
uses: actions/setup-python@v2
87-
with:
88-
python-version: '3.8'
89-
- name: Install Python dependencies
90-
run: python -m pip install --upgrade tox
91-
- name: Run tests
92-
run: tox -v -e py38-test-alldeps-devastropy -- --remote-data
93-
9468
egg_info:
9569
name: egg_info with Python 3.7
9670
runs-on: ubuntu-latest

tox.ini

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{37,38,39,310}-test{,-alldeps,-oldestdeps}{,-devastropy}{,-cov}
3+
py{37,38,39,310}-test{,-alldeps,-oldestdeps,-devdeps,-predeps}{,-cov}
44
codestyle
55
build_docs
66
requires =
@@ -27,12 +27,11 @@ changedir = .tmp/{envname}
2727
description = run tests
2828

2929
deps =
30-
devastropy: git+https://github.com/astropy/astropy.git#egg=astropy
30+
devdeps: git+https://github.com/astropy/astropy.git#egg=astropy
31+
devdeps: git+https://github.com/astropy/pyvo.git#egg=pyvo
3132

32-
# TODO: Add more versions to oldestdeps. numpy<1.15 could not be installed
33-
# in CI, a much newer version was pulled in instead, thus setting
34-
# minimum numpy to 1.15. mpl while not a dependency, it's required for the
35-
# tests, and would pull up a newer numpy version if not pinned.
33+
# TODO: Add more versions to oldestdeps.
34+
# mpl while not a dependency, it's required for the tests, and would pull up a newer numpy version if not pinned.
3635

3736
oldestdeps: astropy==4.0
3837
oldestdeps: numpy==1.16
@@ -51,6 +50,18 @@ commands =
5150
cov: pytest --pyargs astroquery {toxinidir}/docs --ignore={toxinidir}/docs/gallery* --cov astroquery --cov-config={toxinidir}/setup.cfg {posargs}
5251
cov: coverage xml -o {toxinidir}/coverage.xml
5352

53+
[testenv:predeps]
54+
description = run tests with pre-releases
55+
pip_pre = True
56+
57+
deps = {[testenv]deps}
58+
passenv = {[testenv]passenv}
59+
pypi_filter = {[testenv]pypi_filter}
60+
changedir = {[testenv]changedir}
61+
extras = {[testenv]extras}
62+
commands = {[testenv]commands}
63+
64+
5465
[testenv:codestyle]
5566
changedir = {toxinidir}
5667
skip_install = true

0 commit comments

Comments
 (0)