summaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-28 23:03:55 +0100
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-11-28 23:48:04 +0100
commitbc9d7a47eaab965d4367a0ce0278acb9c534bbe0 (patch)
tree20522b4e91b128fef3a61ab67c05789e3f9891f5 /.github
parentde3ef16c40a38b229b0b93fec55fae20f8baaea0 (diff)
GitHub Actions: Deduplicate pre-commit job
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/pre-commit.yml32
1 files changed, 16 insertions, 16 deletions
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index e1f6e70933..1d62f305ed 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -8,30 +8,30 @@ jobs:
pre-commit:
name: Detecting code style issues
runs-on: ubuntu-latest
- if: github.event_name == 'push'
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-python@v2
+ - name: "Check out repository"
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 2
+
+ - name: "Set up Python"
+ uses: actions/setup-python@v2
+
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-format-10
- - uses: pre-commit/action@v2.0.0
+
+ - name: "Detect code style issues (push)"
+ uses: pre-commit/action@v2.0.0
+ if: github.event_name == 'push'
# There are too many files in the repo that have formatting issues. We'll
# disable these checks for now when pushing directly (but still run these
# on Pull Requests!).
env:
SKIP: end-of-file-fixer,trailing-whitespace,clang-format,eslint,no-commit-to-branch
- pre-commit-pr:
- name: Detecting code style issues
- runs-on: ubuntu-latest
- if: github.event_name == 'pull_request'
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 2
- - uses: actions/setup-python@v2
- - name: Install clang-format
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-format-10
- - uses: pre-commit/action@v2.0.0
+
+ - name: "Detect code style issues (pull_request)"
+ uses: pre-commit/action@v2.0.0
+ if: github.event_name == 'pull_request'
env:
SKIP: no-commit-to-branch
with: