Skip to content

Commit

Permalink
CI: Configure pre-commit.ci (#213)
Browse files Browse the repository at this point in the history
* Remove pre-commit from GH actions

* Small change to trigger CI

* Attempt fix MyPy CI

* Attempt fix MyPy CI 2

* Attempt fix MyPi ci 3

* Attempt fix MyPi CI 4

* Attempt fix MyPy CI 5

* Attempt fix MYPy CI 6

* Attempt fix MyPy CI 7

* Use pre-commit action

* Create seperate workflow for pre-commit
  • Loading branch information
Jeffrey-Lim authored Jun 28, 2024
1 parent fd93f52 commit 914b262
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/main-branch-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,7 @@ on:
branches: [ "main" ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

build:

runs-on: ubuntu-latest
container:
image: python:3.11-slim
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Static Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "v*" ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- name: Set up Python 3.10.14
uses: actions/setup-python@v5.1.0
with:
python-version: 3.10.14
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
12 changes: 0 additions & 12 deletions .github/workflows/version-branch-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ on:
branches: ["v*"]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/setup-python@v5.1.0
with:
python-version: 3.10.14
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

pytest:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
exclude: ^(external/|venv/|.venv/|tests/|.cache)
ci:
skip: [mypy]
repos:
- repo: local # Remove this when a new version of pre-commit-hooks (>4.6.0) is released
hooks:
Expand Down Expand Up @@ -68,10 +70,10 @@ repos:
hooks:
- id: mypy
additional_dependencies:
- "--extra-index-url=https://download.pytorch.org/whl/cpu"
- numpy==1.26.4
- pandas-stubs>=2.2.2.240514
- matplotlib==3.8.4
- torch==2.3.1
- torch==2.3.1+cpu
- dask==2024.6.2
- typing_extensions==4.9.0
- annotated-types==0.7.0
Expand Down

0 comments on commit 914b262

Please sign in to comment.