ci: run pre-commit checks first
This commit is contained in:
parent
52c20738f9
commit
d94d99a942
26
.github/workflows/build.yml
vendored
26
.github/workflows/build.yml
vendored
@ -11,6 +11,25 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
name: Pre-commit check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout git repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.9"
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '21'
|
||||||
|
- name: Pre-commit checks
|
||||||
|
uses: pre-commit/action@v3.0.0
|
||||||
|
- name: pre-commit-ci-lite
|
||||||
|
uses: pre-commit-ci/lite-action@v1.1.0
|
||||||
|
if: always()
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@ -26,11 +45,6 @@ jobs:
|
|||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: 21
|
java-version: 21
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- name: Cache Maven packages
|
cache: 'maven'
|
||||||
uses: actions/cache@v4.1.1
|
|
||||||
with:
|
|
||||||
path: ~/.m2
|
|
||||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: ${{ runner.os }}-m2-
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn --no-transfer-progress verify
|
run: mvn --no-transfer-progress verify
|
||||||
|
29
.github/workflows/pre-commit.yaml
vendored
29
.github/workflows/pre-commit.yaml
vendored
@ -1,29 +0,0 @@
|
|||||||
name: Pre-commit check
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [main]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
jobs:
|
|
||||||
pre-commit:
|
|
||||||
name: Pre-commit check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout git repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Setup python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.9"
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '21'
|
|
||||||
- name: Pre-commit checks
|
|
||||||
uses: pre-commit/action@v3.0.0
|
|
||||||
- name: pre-commit-ci-lite
|
|
||||||
uses: pre-commit-ci/lite-action@v1.1.0
|
|
||||||
if: always()
|
|
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@ -21,13 +21,7 @@ jobs:
|
|||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: 21
|
java-version: 21
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
cache: 'maven'
|
||||||
- name: Cache Maven packages
|
|
||||||
uses: actions/cache@v4.1.1
|
|
||||||
with:
|
|
||||||
path: ~/.m2
|
|
||||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: ${{ runner.os }}-m2
|
|
||||||
|
|
||||||
- name: "Set labels for ${{ github.ref }}"
|
- name: "Set labels for ${{ github.ref }}"
|
||||||
run: |
|
run: |
|
||||||
|
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@ -35,13 +35,7 @@ jobs:
|
|||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: 21
|
java-version: 21
|
||||||
architecture: x64
|
architecture: x64
|
||||||
#Uses an action to set up a cache using a certain key based on the hash of the dependencies
|
cache: 'maven'
|
||||||
- name: Cache Maven packages
|
|
||||||
uses: actions/cache@v4.1.1
|
|
||||||
with:
|
|
||||||
path: ~/.m2
|
|
||||||
key: ubuntu-latest-m2-${{ hashFiles('**/pom.xml') }}
|
|
||||||
restore-keys: ubuntu-latest-m2-
|
|
||||||
- uses: BSFishy/pip-action@v1
|
- uses: BSFishy/pip-action@v1
|
||||||
with:
|
with:
|
||||||
packages: |
|
packages: |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user