Skip to content

Commit

Permalink
NUTCH-3015 Add more CI steps to GitHub master-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lewismc committed Oct 23, 2023
1 parent 8431dcf commit af022bb
Show file tree
Hide file tree
Showing 79 changed files with 1,272 additions and 45 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: master pr build

on:
schedule:
- cron: '0 0 * * *' # every day at midnight

jobs:
dependency-check:
strategy:
matrix:
java: ['11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Dependency check
run: ant clean dependency-check -buildfile build.xml
60 changes: 44 additions & 16 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
Expand All @@ -13,28 +12,57 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: master pr build
name: master pull request ci

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
javadoc:
strategy:
matrix:
java: [ '11' ]

java: ['11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Javadoc
run: ant clean javadoc -buildfile build.xml
rat:
strategy:
matrix:
java: ['11']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Run Apache Rat
run: ant clean run-rat -buildfile build.xml
- name: Cache unknown licenses
run: sed -n 18p build/apache-rat-report.txt=$unknown_licenses
- name: Fail if any unknown licenses
if: ${{ '${{ env.unknown_licenses }}' != '0 Unknown Licenses' }}
run: exit 1
test:
strategy:
matrix:
java: ['11']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Build with Ant
run: ant clean nightly javadoc -buildfile build.xml
- name: Test
run: ant clean test -buildfile build.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ csvindexwriter
lib/spotbugs-*
ivy/dependency-check-ant/*
.gradle*
ivy/apache-rat-*
34 changes: 25 additions & 9 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<property name="maven-javadoc-jar" value="${release.dir}/${artifactId}-${version}-javadoc.jar" />
<property name="maven-sources-jar" value="${release.dir}/${artifactId}-${version}-sources.jar" />

<property name="dependency-check-ant.version" value="7.1.1" />
<property name="dependency-check-ant.version" value="8.4.2" />
<property name="dependency-check-ant.home" value="${ivy.dir}/dependency-check-ant" />
<property name="dependency-check-ant.jar" value="${dependency-check-ant.home}/dependency-check-ant.jar" />

Expand All @@ -48,7 +48,7 @@
<property name="spotbugs.home" value="${ivy.dir}/spotbugs-${spotbugs.version}" />
<property name="spotbugs.jar" value="${spotbugs.home}/lib/spotbugs-ant.jar" />

<property name="apache-rat.version" value="0.14" />
<property name="apache-rat.version" value="0.15" />
<property name="apache-rat.home" value="${ivy.dir}/apache-rat-${apache-rat.version}" />
<property name="apache-rat.jar" value="${apache-rat.home}/apache-rat-${apache-rat.version}.jar" />

Expand Down Expand Up @@ -640,13 +640,15 @@
</fileset>
</path>

<target name="report-vulnerabilities" depends="jar, compile-plugins, dependency-check-ant-download" description="--> check dependencies for security vulnerabilities">
<target name="dependency-check" depends="jar, compile-plugins, dependency-check-ant-download" description="--> check dependencies for security vulnerabilities">
<taskdef resource="dependency-check-taskdefs.properties">
<classpath refid="dependency-check-ant.path" />
</taskdef>
<dependency-check projectname="${name}"
reportoutputdirectory="${dependency-check-ant.home}"
reportformat="ALL">
reportformat="ALL"
assemblyAnalyzerEnabled="false"
failBuildOnCVSS="1">
<suppressionfile path="${dependency-check-ant.home}/dependency-check-suppressions.xml" />
<retirejsFilter regex="copyright.*jeremy long" />
<fileset dir="${build.dir}">
Expand Down Expand Up @@ -1025,7 +1027,7 @@

<target name="apache-rat-download-unchecked" unless="apache-rat.jar.found"
description="--> downloads the Apache Rat jar">
<get src="https://www.apache.org/dist/creadur/apache-rat-${apache-rat.version}/apache-rat-${apache-rat.version}-bin.tar.gz"
<get src="https://archive.apache.org/dist/creadur/apache-rat-${apache-rat.version}/apache-rat-${apache-rat.version}-bin.tar.gz"
dest="${ivy.dir}/apache-rat-${apache-rat.version}-bin.tar.gz" usetimestamp="false" />

<untar src="${ivy.dir}/apache-rat-${apache-rat.version}-bin.tar.gz"
Expand All @@ -1035,8 +1037,8 @@
<delete file="${ivy.dir}/apache-rat-${apache-rat.version}-bin.tar.gz" />
</target>

<target name="rat-sources" depends="init, apache-rat-download"
description="--> runs RAT tasks over src/java">
<target name="run-rat" depends="init, apache-rat-download"
description="--> runs Apache Rat on codebase">
<taskdef
uri="antlib:org.apache.rat.anttasks"
resource="org/apache/rat/anttasks/antlib.xml">
Expand All @@ -1047,8 +1049,22 @@
<rat:report
reportFile="${build.dir}/apache-rat-report.txt">
<fileset dir="src">
<include name="java/**/*"/>
<include name="plugin/**/src/**/*"/>
<include name="**"/>
<exclude name="plugin/language-identifier/src/java/org/apache/nutch/analysis/lang/langmappings.properties"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/de.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/en.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/es.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/fi.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/fr.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/it.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/nl.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/pt.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/sv.test"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/test-referencial.txt"/>
<exclude name="plugin/language-identifier/src/test/org/apache/nutch/analysis/lang/da.test"/>
<exclude name="plugin/parse-tika/sample/ootest.txt"/>
<exclude name="plugin/parse-tika/sample/test.rtf"/>
<exclude name="plugin/urlfilter-ignoreexempt/data/.donotdelete"/>
</fileset>
</rat:report>
</target>
Expand Down
5 changes: 0 additions & 5 deletions ivy/dependency-check-ant/dependency-check-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.1.xsd">
<suppress>
<notes>only applies to tika-server &lt; 1.18</notes>
<gav regex="true">^org\.(apache\.tika:tika-(core|parsers)|gagravarr:vorbis-java-tika):.*$</gav>
<cve>CVE-2018-1335</cve>
</suppress>
</suppressions>
16 changes: 16 additions & 0 deletions src/java/overview.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<title>Apache Nutch</title>
Expand Down
15 changes: 15 additions & 0 deletions src/plugin/creativecommons/conf/crawl-urlfilter.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Creative Commnons crawl filter

# Each non-comment, non-blank line contains a regular expression
Expand Down
16 changes: 16 additions & 0 deletions src/plugin/creativecommons/conf/nutch-site.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

Expand Down
16 changes: 16 additions & 0 deletions src/plugin/creativecommons/data/anchor.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
Expand Down
16 changes: 16 additions & 0 deletions src/plugin/creativecommons/data/rdf.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
Expand Down
16 changes: 16 additions & 0 deletions src/plugin/creativecommons/data/rel.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
</head><body>
Expand Down
17 changes: 17 additions & 0 deletions src/plugin/exchange-jexl/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

exchange-jexl plugin for Nutch
==============================

Expand Down
17 changes: 17 additions & 0 deletions src/plugin/index-links/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

indexer-links plugin for Nutch
==============================

Expand Down
16 changes: 16 additions & 0 deletions src/plugin/index-replace/sample/testIndexReplace.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<title>Testing the power of the index-replace plugin</title>
Expand Down
Loading

0 comments on commit af022bb

Please sign in to comment.