Skip to content

Commit

Permalink
Merge pull request #394 from lsst-sqre/tickets/DM-45794
Browse files Browse the repository at this point in the history
DM-45794: Update GitHub Actions configuration
  • Loading branch information
rra authored Aug 16, 2024
2 parents eb5c3c3 + 12c0565 commit e695f03
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 76 deletions.
56 changes: 40 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
name: CI

env:
# Current supported Python version for the controller. For applications,
# there is generally no reason to support multiple Python versions, so all
# actions are run with this version. Quote the version to avoid
# interpretation as a floating point number.
#
# The JupyterHub plugins use a separate matrix of versions because they have
# to work with the version of Python that is included in the JupyterHub
# images.
PYTHON_VERSION: "3.12"

"on":
merge_group: {}
pull_request: {}
Expand All @@ -20,27 +31,22 @@ name: CI
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: ${{ env.PYTHON_VERSION }}

- name: Run pre-commit
uses: pre-commit/[email protected]

test:
runs-on: ubuntu-latest
timeout-minutes: 15

strategy:
matrix:
python:
- "3.12"
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
Expand All @@ -50,9 +56,9 @@ jobs:
cache-dependency: "controller/requirements/*.txt"
cache-key-prefix: test
nox-sessions: "typing typing-inithome test test-inithome"
python-version: ${{ matrix.python }}
python-version: ${{ env.PYTHON_VERSION }}

# The controller requires Python 3.11, but the modules we add to the Hub
# The controller requires Python 3.12, but the modules we add to the Hub
# have to run with Python 3.10 since that's what the JupyterHub image uses.
# Run a separate matrix to test those modules.
test-hub:
Expand Down Expand Up @@ -105,11 +111,7 @@ jobs:
cache-dependency: "controller/requirements/*.txt"
cache-key-prefix: docs
nox-sessions: docs
python-version: "3.12"

# Manually install setuptools, which is required for Python 3.12.
- name: Install setuptools
run: pip install setuptools
python-version: ${{ env.PYTHON_VERSION }}

# Upload docs:
# - on any push to main
Expand All @@ -123,7 +125,29 @@ jobs:
password: ${{ secrets.LTD_PASSWORD }}
if: >
(github.event_name == 'push' && github.ref_name == 'main')
|| (github.event_name == 'pull_request' && startsWith(github.head_ref, 'tickets/') && steps.filter.outputs.docs == 'true')
|| (github.event_name == 'pull_request'
&& startsWith(github.head_ref, 'tickets/')
&& steps.filter.outputs.docs == 'true')
linkcheck:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v4

- name: Update package lists
run: sudo apt-get update

- name: Install extra packages
run: sudo apt install -y graphviz

- uses: lsst-sqre/run-nox@v1
with:
cache-dependency: "controller/requirements/*.txt"
cache-key-prefix: docs
nox-sessions: docs-linkcheck
python-version: ${{ env.PYTHON_VERSION }}

build:
runs-on: ubuntu-latest
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/linkcheck.yaml

This file was deleted.

57 changes: 48 additions & 9 deletions .github/workflows/periodic-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

name: Periodic CI

env:
# Current supported Python version for the controller. For applications,
# there is generally no reason to support multiple Python versions, so all
# actions are run with this version. Quote the version to avoid
# interpretation as a floating point number.
#
# The JupyterHub plugins use a separate matrix of versions because they have
# to work with the version of Python that is included in the JupyterHub
# images.
PYTHON_VERSION: "3.12"

"on":
schedule:
- cron: "0 12 * * 1"
Expand All @@ -14,22 +25,17 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20

strategy:
matrix:
python:
- "3.12"

steps:
- uses: actions/checkout@v4

- uses: lsst-sqre/run-nox@v1
with:
nox-sessions: "update-deps typing test"
python-version: ${{ matrix.python }}
python-version: ${{ env.PYTHON_VERSION }}
use-cache: false

- name: Report status
if: always()
if: failed()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand All @@ -38,7 +44,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

# The controller requires Python 3.11, but the modules we add to the Hub
# The controller requires Python 3.12, but the modules we add to the Hub
# have to run with Python 3.10 since that's what the JupyterHub image uses.
# Run a separate matrix to test those modules.
test-hub:
Expand All @@ -63,11 +69,44 @@ jobs:
use-cache: false

- name: Report status
if: always()
if: failure()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Periodic test for {repo} failed"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

docs:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Update package lists
run: sudo apt-get update

- name: Install extra packages
run: sudo apt install -y graphviz

- uses: lsst-sqre/run-nox@v1
with:
cache-dependency: "controller/requirements/*.txt"
cache-key-prefix: docs
nox-sessions: "docs docs-linkcheck"
python-version: ${{ env.PYTHON_VERSION }}

- name: Report status
if: failure()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Periodic link check for {repo} failed"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}

0 comments on commit e695f03

Please sign in to comment.