Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-3084 Improve CI by filtering and separating plugin and core test execution (#833)

Lewis John McGibbney5961e26fb999
diff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.yml
index db24168b9..02176a51d 100644
--- a/.github/workflows/master-build.yml
+++ b/.github/workflows/master-build.yml
@@ -14,14 +14,12 @@
# limitations under the License.
name: master pull request ci
-
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
branches: [master]
-
jobs:
javadoc:
strategy:
@@ -30,9 +28,9 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/[email protected]
+ - uses: actions/[email protected]
- name: Set up JDK ${{ matrix.java }}
- uses: actions/[email protected]
+ uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
@@ -45,9 +43,9 @@ jobs:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/[email protected]
+ - uses: actions/[email protected]
- name: Set up JDK ${{ matrix.java }}
- uses: actions/[email protected]
+ uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
@@ -61,18 +59,34 @@ jobs:
- name: Fail if any unknown licenses
if: ${{ env.UNKNOWN_LICENSES != '0 Unknown Licenses' }}
run: exit 1
- test:
+ tests:
strategy:
matrix:
java: ['11']
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/[email protected]
+ - uses: actions/[email protected]
- name: Set up JDK ${{ matrix.java }}
- uses: actions/[email protected]
+ uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- - name: Test
- run: ant clean test -buildfile build.xml
+ - uses: dorny/[email protected]
+ id: filter
+ with:
+ filters: |
+ core:
+ - 'src/java/**'
+ - 'src/test/**'
+ - 'src/testresources/**'
+ plugins:
+ - 'src/plugin/**'
+ # run only if 'core' files were changed
+ - name: test core
+ if: steps.filter.outputs.core == 'true'
+ run: ant clean test-core -buildfile build.xml
+ # run only if 'plugins' files were changed
+ - name: test plugins
+ if: steps.filter.outputs.plugins == 'true'
+ run: ant clean test-plugins -buildfile build.xml