Skip to content

Commit 785d78a

Browse files
authored
Merge pull request #1936 from pllim/tst-cron
TST: Add remote data cron job, minor workflow clean-ups
2 parents 637946c + 274927e commit 785d78a

File tree

2 files changed

+40
-12
lines changed

2 files changed

+40
-12
lines changed

.github/workflows/ci_tests.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: CI
22

33
on:
44
push:
5+
branches:
6+
- master
7+
tags:
8+
- '*'
59
pull_request:
10+
branches:
11+
- master
612
schedule:
713
# run every Monday at 5am UTC
814
- cron: '0 5 * * 1'
915

10-
env:
11-
TOXARGS: '-v'
12-
1316
jobs:
1417
tests:
1518
name: ${{ matrix.name }}
@@ -28,26 +31,31 @@ jobs:
2831
os: ubuntu-latest
2932
python: 3.8
3033
toxenv: build_docs
34+
toxargs: -v
3135

3236
- name: oldest dependencies
3337
os: ubuntu-latest
3438
python: 3.6
3539
toxenv: py36-test-oldestdeps
40+
toxargs: -v
3641

3742
- name: astropy dev with all dependencies with coverage
3843
os: ubuntu-latest
3944
python: 3.9
4045
toxenv: py39-test-alldeps-devastropy-cov
46+
toxargs: -v
4147

4248
- name: Python 3.7 with all optional dependencies (MacOS X)
4349
os: macos-latest
4450
python: 3.7
4551
toxenv: py37-test-alldeps
52+
toxargs: -v
4653

4754
- name: Python 3.8 with mandatory dependencies (Windows)
4855
os: windows-latest
4956
python: 3.8
5057
toxenv: py38-test
58+
toxargs: -v
5159

5260
steps:
5361
- name: Checkout code
@@ -59,15 +67,35 @@ jobs:
5967
with:
6068
python-version: ${{ matrix.python }}
6169
- name: Install Python dependencies
62-
run: python -m pip install --upgrade tox codecov
70+
run: python -m pip install --upgrade tox
6371
- name: Run tests
64-
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }}
72+
run: tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
6573
- name: Upload coverage to codecov
66-
if: ${{ contains(matrix.toxenv,'-cov') }}
74+
if: contains(matrix.toxenv,'-cov')
6775
uses: codecov/codecov-action@v1
6876
with:
6977
file: ./coverage.xml
7078

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

72100
egg_info:
73101
name: egg_info with Python 3.7

tox.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ requires =
99
tox-pypi-filter >= 0.12
1010
isolated_build = true
1111

12-
1312
[testenv]
1413

1514
# The following option combined with the use of the tox-pypi-filter above allows
@@ -33,6 +32,8 @@ deps =
3332
# TODO: Add more versions to oldestdeps
3433
oldestdeps: astropy==3.1
3534

35+
cov: codecov
36+
3637
extras =
3738
test
3839
!py39-alldeps: all_lt_39
@@ -41,9 +42,9 @@ extras =
4142
commands =
4243
pip freeze
4344
# FIXME: there are too many failures from the docs example gallery ignore docs for now
44-
# !cov: pytest {toxinidir}/astroquery {toxinidir}/docs
45-
!cov: pytest {toxinidir}/astroquery
46-
cov: pytest {toxinidir}/astroquery --cov {toxinidir}/astroquery
45+
# !cov: pytest {toxinidir}/astroquery {toxinidir}/docs {posargs}
46+
!cov: pytest {toxinidir}/astroquery {posargs}
47+
cov: pytest {toxinidir}/astroquery --cov {toxinidir}/astroquery {posargs}
4748
cov: coverage xml -o {toxinidir}/coverage.xml
4849

4950
[testenv:codestyle]
@@ -53,9 +54,8 @@ description = check code style
5354
deps = pycodestyle
5455
commands = pycodestyle astroquery --count
5556

56-
5757
[testenv:build_docs]
58-
changedir =
58+
changedir = {toxinidir}
5959
description = Building the narrative and API docs
6060
extras = docs
6161
requires =

0 commit comments

Comments
 (0)