Skip to content

Commit

Permalink
Fix GHA dependencies and add lint job
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed May 15, 2024
1 parent e0eb209 commit d27bda3
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@ name: Documentation Tests
on: [push, pull_request]

jobs:
Doc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r dev/requirements.txt
- name: Build doc
run: |
cd doc && make html
cd ..
CheckDocs:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -62,7 +82,7 @@ jobs:
DeployMainDoc:
runs-on: ubuntu-latest
needs: [Test,Lint,Doc]
needs: [CheckDocs, Doc]
if: github.ref == 'refs/heads/main'

steps:
Expand Down Expand Up @@ -91,7 +111,7 @@ jobs:

DeployDevelopmentDoc:
runs-on: ubuntu-latest
needs: [Test,Lint,Doc]
needs: [CheckDocs, Doc]
# Only run on pull requests to main and non-forks
if: github.event_name == 'pull_request' && github.base_ref == 'main' && ! github.event.pull_request.head.repo.fork
steps:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on: [push, pull_request]

jobs:
Lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install -r requirements_dev.txt
pip install -r dev/requirements.txt
- name: Lint
run: |
pre-commit run --all-files 2> /dev/null
ec=$?
git diff -U0 > log.txt && cat log.txt
exit $ec

0 comments on commit d27bda3

Please sign in to comment.