From 2d4f2f3a428ccb007a1457f81ce21e56bc577bf6 Mon Sep 17 00:00:00 2001 From: esc Date: Thu, 6 Feb 2025 14:42:44 +0100 Subject: [PATCH 1/3] adding pre-commit workflow As title --- .github/workflows/pre-commit.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/pre-commit.yml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..82d68daa9 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,28 @@ +name: lint with pre-commit + +on: + pull_request: + push: + branches: + - main + tags: + - '*' + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + auto-activate-base: false + - name: Install pre-commit + run: conda install pre-commit + - name: Lint code with pre-commit + run: pre-commit run --verbose --all-files From 62977a52df96ca17ea6bba413f054f9bf938cfe6 Mon Sep 17 00:00:00 2001 From: esc Date: Thu, 6 Feb 2025 14:54:46 +0100 Subject: [PATCH 2/3] use pre-commit from conda-forge As title --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 82d68daa9..8f9fe653d 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -23,6 +23,6 @@ jobs: auto-update-conda: true auto-activate-base: false - name: Install pre-commit - run: conda install pre-commit + run: conda install -c conda-forge pre-commit - name: Lint code with pre-commit run: pre-commit run --verbose --all-files From a7fbfa158f2a63856204499e12a88a1c8822dc43 Mon Sep 17 00:00:00 2001 From: esc Date: Thu, 6 Feb 2025 14:56:10 +0100 Subject: [PATCH 3/3] rename job As title --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 8f9fe653d..a27723ca8 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,7 +9,7 @@ on: - '*' jobs: - test: + pre-commit: runs-on: ubuntu-latest defaults: run: