Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-4324 update pr verify actions #4325

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 28 additions & 30 deletions .github/workflows/pr-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ name: PR verify
on: pull_request

jobs:
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Check formatting
run: mvn -B formatter:validate impsort:check xml-format:xml-check
- name: Cancel workflow on failure
uses: vishnudxb/[email protected]
if: failure()
with:
repo: eclipse/rdf4j
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}
Comment on lines +18 to +24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if we make this its own job, we can get rid of this cancel step.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but don't we want to cancel the other jobs because they will need to run with the next push that has a formatting fix? So cancelling now saves some energy?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point. I had it in my head that this would only cancel the current job - but if it also kills the parallel jobs then it's definitely worth leaving in.

build:
runs-on: ubuntu-latest
strategy:
Expand All @@ -11,18 +30,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.jdk }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk${{ matrix.jdk }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk${{ matrix.jdk }}-maven-
- name: Check formatting
run: mvn -B formatter:validate impsort:check xml-format:xml-check
cache: 'maven'
- name: Build
run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true
- name: Test
Expand All @@ -44,18 +56,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk11-maven-
- name: Check formatting
run: mvn -B formatter:validate impsort:check xml-format:xml-check
cache: 'maven'
- name: Build
run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true
- name: Verify
Expand All @@ -77,18 +82,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk11-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk11-maven-
- name: Check formatting
run: mvn -B formatter:validate impsort:check xml-format:xml-check
cache: 'maven'
- name: Build
run: mvn -B -U -T 2 clean install -Pquick,-formatting -Dmaven.javadoc.skip=true -Djapicmp.skip -Denforcer.skip=true -Danimal.sniffer.skip=true
- name: Verify
Expand Down