Skip to content
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

DM-39627: Run neophile from GitHub Actions #278

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ jobs:
python-version: ${{ matrix.python }}
tox-envs: "py,coverage-report,typing"

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

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install neophile
run: pip install neophile

- name: Run neophile
run: neophile check python

build:
runs-on: ubuntu-latest
needs: [lint, test]
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Dependency Update

"on":
schedule:
- cron: "0 12 * * 1"
workflow_dispatch: {}

jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install neophile
run: pip install neophile

- name: Run neophile
run: neophile update --pr pre-commit
env:
NEOPHILE_COMMIT_EMAIL: "24442459+sqrbot@users.noreply.github.com"
NEOPHILE_GITHUB_APP_ID: ${{ secrets.NEOPHILE_APP_ID }}
NEOPHILE_GITHUB_PRIVATE_KEY: ${{ secrets.NEOPHILE_PRIVATE_KEY }}

- name: Report status
if: always()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Periodic dependency update for {repo} failed"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}
53 changes: 53 additions & 0 deletions .github/workflows/periodic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This is a separate run of the Python test suite that doesn't cache the tox
# environment and runs from a schedule. The purpose is to test whether
# updating pinned dependencies would cause any tests to fail.

name: Periodic CI

"on":
schedule:
- cron: "0 12 * * 1"
workflow_dispatch: {}

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
python:
- "3.11"

steps:
- uses: actions/checkout@v3

# Use the oldest supported version of Python to update dependencies,
# not the matrixed Python version, since this accurately reflects
# how dependencies should later be updated.
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install neophile
run: pip install neophile

- name: Run neophile
run: neophile update

- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python }}
tox-envs: "lint,typing,py"

- name: Report status
if: always()
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 }}