Skip to content
6 changes: 4 additions & 2 deletions .github/workflows/dev_tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: dev tests

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
schedule:
- cron: '0 0 * * *'


permissions:
contents: write
issues: write
Expand Down Expand Up @@ -34,7 +36,7 @@ jobs:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
ENV : "dev"
run: pytest -r nmdc_api_utilities/test/
run: pytest -x nmdc_api_utilities/test/
- name: Create Issue
if: failure() && github.event.pull_request == null && github.event_name == 'schedule'
uses: actions/github-script@v6
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: documentation

on: [push, pull_request, workflow_dispatch]
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

permissions:
contents: write
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run pre-commit hooks & push changes

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.py'


permissions:
contents: write


jobs:
run-hooks:
name: Run Pre-Commit hooks and push changes back
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}

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

- name: Install pre-commit
run: |
python -m pip install --upgrade pip
python -m pip install pre-commit

- name: Run pre-commit hooks
run: |
pre-commit run --all-files || true

- name: Commit and push changes if pre-commit made any modifications
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "precommit: reformat"
git push
fi
5 changes: 4 additions & 1 deletion .github/workflows/prod_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: prod tests

on:
push:
branches: [ main ]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
Expand Down Expand Up @@ -33,7 +36,7 @@ jobs:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
ENV : "prod"
run: pytest -r nmdc_api_utilities/test/
run: pytest -x nmdc_api_utilities/test/
- name: Create Issue
if: failure() && github.event.pull_request == null && github.event_name == 'schedule'
uses: actions/github-script@v6
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
dependencies = ["pandas~=2.2.3", "requests~=2.32.3", "matplotlib~=3.10.0"]
license-files = ["LICENSE"]
dynamic = ["dependencies"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Loading