diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd61ce495e..969cb3ddb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,34 +8,25 @@ on: types: [opened, synchronize, reopened, ready_for_review] workflow_dispatch: +# Only run the latest job +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + jobs: build-all: name: Compile (no tests) with JDK 11 runs-on: ubuntu-latest steps: - - uses: n1hility/cancel-previous-runs@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: m2-${{ hashFiles('**/pom.xml') }} - restore-keys: | - m2- - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 - - name: Generate settings.xml for Maven Builds - uses: whelk-io/maven-settings-xml-action@v20 - with: - repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]' - - name: Print Version - run: mvn -v + cache: 'maven' - name: Build - run: mvn -U -B -fae -DskipTests -Dfindbugs clean install + run: mvn -V -U -B -fae -DskipTests -Dfindbugs clean install - name: Tar Maven Repo shell: bash run: tar -czf maven-repo.tgz -C ~ .m2/repository @@ -77,13 +68,10 @@ jobs: echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts shell: cmd - - uses: n1hility/cancel-previous-runs@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Host information run: | hostname || true - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download Maven Repo uses: actions/download-artifact@v4 with: @@ -93,18 +81,13 @@ jobs: shell: bash run: tar -xzf maven-repo.tgz -C ~ - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: ${{ matrix.openjdk_impl }} java-version: ${{ matrix.jdk }} - - name: Generate settings.xml for Maven Builds - uses: whelk-io/maven-settings-xml-action@v20 - with: - repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]' - - name: Print Version - run: mvn -v + cache: 'maven' - name: Run Tests - run: mvn -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }} + run: mvn -V -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }} '-P-java${{ matrix.jdk }}-test-classpath' - uses: actions/upload-artifact@v4 if: failure() with: @@ -130,13 +113,10 @@ jobs: sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts" sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts" sudo sysctl -w fs.file-max=2097152 - - uses: n1hility/cancel-previous-runs@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Host information run: | hostname || true - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download Maven Repo uses: actions/download-artifact@v4 with: @@ -146,17 +126,13 @@ jobs: shell: bash run: tar -xzf maven-repo.tgz -C ~ - name: Set up JDK ${{ matrix.java }} - uses: joschi/setup-jdk@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.jdk }} - - name: Generate settings.xml for Maven Builds - uses: whelk-io/maven-settings-xml-action@v20 - with: - repositories: '[{ "id": "jboss", "name": "JBoss", "url": "https://repository.jboss.org/nexus/content/groups/public" }]' - - name: Print Version - run: mvn -v + distribution: 'temurin' + cache: 'maven' - name: Run Tests - run: mvn -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true + run: mvn -V -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true '-P-java${{ matrix.jdk }}-test-classpath' - uses: actions/upload-artifact@v4 if: failure() with: