Skip to content

Commit

Permalink
add doc test
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Dec 15, 2023
1 parent 8abd32a commit 94ccf49
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
67 changes: 50 additions & 17 deletions .github/workflows/ci_cron_weekly.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,60 @@
# GitHub Actions workflow that runs on a cron schedule.

name: Cron Scheduled CI Tests
name: Weekly cron

on:
pull_request:
# We also want this workflow triggered if the 'Extra CI' label is added
# or present when PR is updated
types:
- synchronize
- labeled
schedule:
# run at 6am UTC on Mondays
# run every Monday at 6am UTC
- cron: '0 6 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Testing links in documents is a good example of something to run on a schedule
# to catch links that stop working for some reason.
doc_test:
runs-on: ubuntu-latest
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
if: (github.repository == 'astropy/specutils' && (github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Extra CI')))
strategy:
fail-fast: false
matrix:
include:

# We do not use remote data here, since
# that gives too many false positives due to URL timeouts.
- name: Python 3.11 with pre-release version of key dependencies
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-predeps

- name: Documentation link check
os: ubuntu-latest
python: '3.10'
toxenv: linkcheck

steps:
- uses: actions/checkout@v3
- name: Set up Python to build docs with sphinx
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Check links in docs using tox
python-version: ${{ matrix.python }}
- name: Install language-pack-de and tzdata
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
tox -e linkcheck
sudo apt-get update
sudo apt-get install language-pack-de tzdata
- name: Install graphviz
if: ${{ matrix.toxenv == 'linkcheck' }}
run: sudo apt-get install graphviz
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs}} -e ${{ matrix.toxenv}} -- ${{ matrix.toxposargs}}
5 changes: 5 additions & 0 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
python: 3.x
toxenv: codestyle

- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: build_docs

- name: Python 3.11 with astropy data and coverage
os: ubuntu-latest
python: '3.11'
Expand Down

0 comments on commit 94ccf49

Please sign in to comment.