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

[WIP] - feat(CI): add a GitHub action to lint the Markdown and YAML files. #361

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ jobs:
java: [ 8, 11, 14, 15-ea ]
os: [ ubuntu-latest ]
include:
- os: windows-latest
java: 8
- os: windows-latest
java: 8
name: JDK${{ matrix.java }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build
run: |
ant -noinput echoproperties deploy embed test-nio test-status
env:
ANT_OPTS: -Dtest.openssl.exists=false -Dtest.excludePerformance=true -Dtest.exclude=**/TestHttp2Limits.java,org/apache/catalina/connector/TestRequest.java,org/apache/coyote/http11/filters/TestChunkedInputFilter.java,org/apache/catalina/startup/TestTomcat.java,org/apache/coyote/http2/TestHttp2Timeouts.java,org/apache/catalina/core/TestAsyncContextStateChanges.java,org/apache/catalina/valves/TestStuckThreadDetectionValve.java,org/apache/coyote/http11/TestHttp11Processor.java,org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java,org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java,org/apache/catalina/servlets/TestDefaultServletOptions.java,org/apache/catalina/nonblocking/TestNonBlockingAPI.java,org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java,org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java,org/apache/tomcat/websocket/TestWsWebSocketContainer.java,org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java,jakarta/servlet/http/TestHttpServletResponseSendError.java,org/apache/catalina/core/TestAsyncContextImpl.java,org/apache/catalina/servlets/TestWebdavServletOptions.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithoutBom.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithBom.java,org/apache/catalina/authenticator/TestFormAuthenticator.java,org/apache/naming/TestEnvEntry.java,org/apache/tomcat/util/net/TestSSLHostConfigCompat.java,org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java,org/apache/jasper/compiler/TestJspDocumentParser.java,org/apache/catalina/valves/rewrite/TestRewriteValve.java,org/apache/jasper/compiler/TestEncodingDetector.java,org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java,org/apache/jasper/compiler/TestParser.java,org/apache/coyote/http2/TestStreamQueryString.java,org/apache/coyote/http11/TestHttp11InputBuffer.java,org/apache/coyote/http11/TestHttp11InputBufferCRLF.java,org/apache/tomcat/util/net/TestSsl.java,org/apache/coyote/ajp/TestAbstractAjpProcessor.java,org/apache/catalina/tribes/group/TestGroupChannelSenderConnections.java,org/apache/coyote/http2/TestHttp2Section_6_8.java,org/apache/catalina/tribes/group/TestGroupChannelStartStop.java,org/apache/catalina/tribes/group/TestGroupChannelMemberArrival.java,org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java,org/apache/el/TestELInJsp.java,org/apache/coyote/TestIoTimeouts.java,org/apache/catalina/connector/TestMaxConnections.java,org/apache/coyote/http2/TestAsync.java,org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java,org/apache/catalina/tribes/group/interceptors/TestNonBlockingCoordinator.java
- name: Git Checkout
uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build
run: |
ant -noinput echoproperties deploy embed test-nio test-status
env:
ANT_OPTS: -Dtest.openssl.exists=false -Dtest.excludePerformance=true -Dtest.exclude=**/TestHttp2Limits.java,org/apache/catalina/connector/TestRequest.java,org/apache/coyote/http11/filters/TestChunkedInputFilter.java,org/apache/catalina/startup/TestTomcat.java,org/apache/coyote/http2/TestHttp2Timeouts.java,org/apache/catalina/core/TestAsyncContextStateChanges.java,org/apache/catalina/valves/TestStuckThreadDetectionValve.java,org/apache/coyote/http11/TestHttp11Processor.java,org/apache/catalina/tribes/group/interceptors/TestOrderInterceptor.java,org/apache/catalina/tribes/group/interceptors/TestTcpFailureDetector.java,org/apache/catalina/servlets/TestDefaultServletOptions.java,org/apache/catalina/nonblocking/TestNonBlockingAPI.java,org/apache/catalina/authenticator/TestSSOnonLoginAndBasicAuthenticator.java,org/apache/catalina/authenticator/TestSSOnonLoginAndDigestAuthenticator.java,org/apache/tomcat/websocket/TestWsWebSocketContainer.java,org/apache/catalina/startup/TestHostConfigAutomaticDeployment.java,jakarta/servlet/http/TestHttpServletResponseSendError.java,org/apache/catalina/core/TestAsyncContextImpl.java,org/apache/catalina/servlets/TestWebdavServletOptions.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithoutBom.java,org/apache/catalina/servlets/TestDefaultServletEncodingWithBom.java,org/apache/catalina/authenticator/TestFormAuthenticator.java,org/apache/naming/TestEnvEntry.java,org/apache/tomcat/util/net/TestSSLHostConfigCompat.java,org/apache/tomcat/websocket/pojo/TestPojoEndpointBase.java,org/apache/jasper/compiler/TestJspDocumentParser.java,org/apache/catalina/valves/rewrite/TestRewriteValve.java,org/apache/jasper/compiler/TestEncodingDetector.java,org/apache/catalina/core/TestApplicationContextGetRequestDispatcher.java,org/apache/jasper/compiler/TestParser.java,org/apache/coyote/http2/TestStreamQueryString.java,org/apache/coyote/http11/TestHttp11InputBuffer.java,org/apache/coyote/http11/TestHttp11InputBufferCRLF.java,org/apache/tomcat/util/net/TestSsl.java,org/apache/coyote/ajp/TestAbstractAjpProcessor.java,org/apache/catalina/tribes/group/TestGroupChannelSenderConnections.java,org/apache/coyote/http2/TestHttp2Section_6_8.java,org/apache/catalina/tribes/group/TestGroupChannelStartStop.java,org/apache/catalina/tribes/group/TestGroupChannelMemberArrival.java,org/apache/tomcat/websocket/TestWebSocketFrameClientSSL.java,org/apache/el/TestELInJsp.java,org/apache/coyote/TestIoTimeouts.java,org/apache/catalina/connector/TestMaxConnections.java,org/apache/coyote/http2/TestAsync.java,org/apache/catalina/authenticator/TestNonLoginAndBasicAuthenticator.java,org/apache/catalina/tribes/group/interceptors/TestNonBlockingCoordinator.java
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Licensed 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: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master
Copy link
Member Author

Choose a reason for hiding this comment

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

Linters should probably only rull on pull request to speed up build times.
Linting is a more minor test etc.


jobs:
lint:
name: 🧹 Markdown and YAML
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: yaml-lint
uses: ibiqlik/action-yamllint@v3
Copy link
Member Author

Choose a reason for hiding this comment

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

YAML Lint is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation. The new ASF rules mean we can't use third party scripts for GitHub Actions. https://github.com/marketplace/actions/yaml-lint

This YAML check with yamllint can be refactored to run on the official Python GitHub action by installing and running yamllint with pip.

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm install -g markdownlint-cli@0.23.2
- run: markdownlint '**/*.md' --ignore node_modules
jbampton marked this conversation as resolved.
Show resolved Hide resolved
29 changes: 29 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Licensed 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.

# MD001/heading-increment/header-increment
MD001: false

# MD004/ul-style
MD004: false

# MD013/line-length
MD013: false

# MD014/commands-show-output
MD014: false

# MD026/no-trailing-punctuation
MD026: false

# MD040/fenced-code-language
MD040: false
126 changes: 63 additions & 63 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,77 +16,77 @@
dist: bionic
language: java
jobs:
include:
- arch: s390x
jdk: openjdk11
- arch: arm64
jdk: oraclejdk8
- arch: ppc64le
jdk: oraclejdk8
include:
- arch: s390x
jdk: openjdk11
- arch: arm64
jdk: oraclejdk8
- arch: ppc64le
jdk: oraclejdk8

addons:
apt:
packages:
- ant
- build-essential
- automake
- autoconf
- tar
- libssl-dev
- subversion
- git
- libtool-bin
apt:
packages:
- ant
- build-essential
- automake
- autoconf
- tar
- libssl-dev
- subversion
- git
- libtool-bin

install:
- ARCH=`uname -p`
- echo $ARCH
- JDK_X64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz"
- JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz"
- JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.7_10.tar.gz"
- JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u252b09.tar.gz"
- if test "X$ARCH" = "Xaarch64"; then JDK_URL=$JDK_ARM64; elif test "$ARCH" = "ppc64le"; then JDK_URL=$JDK_ppc64le; elif test "$ARCH" = "s390x"; then JDK_URL=$JDK_s390x; else JDK_URL=$JDK_X64; fi
- wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
- if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi
- export JAVA_HOME=`pwd`/jdk
- wget -q https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.9-bin.tar.gz && tar xzf apache-ant-*-bin.tar.gz
- export ANT_HOME=`pwd`/apache-ant-1.10.9
- export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
- java -version
- ant -version
- rm -rf $HOME/tmp
- export CURR_PWD=`pwd`
- svn co -q https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x/ $HOME/tmp/apr
- cd $HOME/tmp/apr
- ./buildconf
- ./configure --prefix=$HOME/tmp/apr-build
- make
- make install
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/tmp/apr-build/lib"
- git clone -q https://github.com/apache/tomcat-native.git $HOME/tmp/tomcat-native
- cd $HOME/tmp/tomcat-native/native
- sh buildconf --with-apr=$HOME/tmp/apr
- ./configure --with-apr=$HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$HOME/tmp/tomcat-native-build
- make
- make install
- cd $CURR_PWD
- yes | cp build.properties.default build.properties
- echo >> build.properties
- echo "test.threads=8" >> build.properties
- echo "test.relaxTiming=true" >> build.properties
- echo "test.excludePerformance=true" >> build.properties
- echo "test.openssl.path=/dev/null/openssl" >> build.properties
- echo "test.apr.loc=$HOME/tmp/tomcat-native-build/lib" >> build.properties
- ARCH=`uname -p`
- echo $ARCH
- JDK_X64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u252b09.tar.gz"
- JDK_ARM64="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_aarch64_linux_hotspot_8u252b09.tar.gz"
- JDK_s390x="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.7_10.tar.gz"
- JDK_ppc64le="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09/OpenJDK8U-jdk_ppc64le_linux_hotspot_8u252b09.tar.gz"
- if test "X$ARCH" = "Xaarch64"; then JDK_URL=$JDK_ARM64; elif test "$ARCH" = "ppc64le"; then JDK_URL=$JDK_ppc64le; elif test "$ARCH" = "s390x"; then JDK_URL=$JDK_s390x; else JDK_URL=$JDK_X64; fi
- wget -q $JDK_URL && tar xzf OpenJDK*.tar.gz
- if test "$ARCH" = "s390x"; then mv jdk-11* jdk; else mv jdk8* jdk; fi
- export JAVA_HOME=`pwd`/jdk
- wget -q https://mirrors.netix.net/apache/ant/binaries/apache-ant-1.10.9-bin.tar.gz && tar xzf apache-ant-*-bin.tar.gz
- export ANT_HOME=`pwd`/apache-ant-1.10.9
- export PATH="$JAVA_HOME/bin:$ANT_HOME/bin:$PATH"
- java -version
- ant -version
- rm -rf $HOME/tmp
- export CURR_PWD=`pwd`
- svn co -q https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x/ $HOME/tmp/apr
- cd $HOME/tmp/apr
- ./buildconf
- ./configure --prefix=$HOME/tmp/apr-build
- make
- make install
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/tmp/apr-build/lib"
- git clone -q https://github.com/apache/tomcat-native.git $HOME/tmp/tomcat-native
- cd $HOME/tmp/tomcat-native/native
- sh buildconf --with-apr=$HOME/tmp/apr
- ./configure --with-apr=$HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$HOME/tmp/tomcat-native-build
- make
- make install
- cd $CURR_PWD
- yes | cp build.properties.default build.properties
- echo >> build.properties
- echo "test.threads=8" >> build.properties
- echo "test.relaxTiming=true" >> build.properties
- echo "test.excludePerformance=true" >> build.properties
- echo "test.openssl.path=/dev/null/openssl" >> build.properties
- echo "test.apr.loc=$HOME/tmp/tomcat-native-build/lib" >> build.properties


script:
- ant -q clean
- travis_wait 60 "./.travis/antTest.sh"
- ant -q clean
- travis_wait 60 "./.travis/antTest.sh"

after_failure:
- tail -n 5000 ant-test.log
- tail -n 5000 test-failures.log
- ls -laR $HOME/tomcat-build-libs
- tail -n 5000 ant-test.log
- tail -n 5000 test-failures.log
- ls -laR $HOME/tomcat-build-libs

notifications:
email:
- dev@tomcat.apache.org
email:
- dev@tomcat.apache.org
20 changes: 20 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Licensed 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.
---

extends: default

rules:
brackets: disable
document-start: disable
line-length: disable
truthy: disable
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Welcome to Apache Tomcat!
# Welcome to Apache Tomcat!

### What Is It?
## What Is It?

The Apache Tomcat® software is an open source implementation of the Java
Servlet, JavaServer Pages, Java Expression Language and Java WebSocket
Expand All @@ -24,11 +24,12 @@ these users and their stories are listed on the
Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat
project logo are trademarks of the Apache Software Foundation.

### Get It
## Get It

For every major Tomcat version there is one download page containing
links to the latest binary and source code downloads, but also
links for browsing the download directories and archives:

- [Tomcat 10](https://tomcat.apache.org/download-10.cgi)
- [Tomcat 9](https://tomcat.apache.org/download-90.cgi)
- [Tomcat 8](https://tomcat.apache.org/download-80.cgi)
Expand All @@ -37,26 +38,27 @@ links for browsing the download directories and archives:
To facilitate choosing the right major Tomcat version one, we have provided a
[version overview page](https://tomcat.apache.org/whichversion.html).

### Documentation
## Documentation

The documentation available as of the date of this release is
included in the docs webapp which ships with tomcat. You can access that webapp
by starting tomcat and visiting <http://localhost:8080/docs/> in your browser.
The most up-to-date documentation for each version can be found at:

- [Tomcat 10](https://tomcat.apache.org/tomcat-10.0-doc/)
- [Tomcat 9](https://tomcat.apache.org/tomcat-9.0-doc/)
- [Tomcat 8](https://tomcat.apache.org/tomcat-8.5-doc/)
- [Tomcat 7](https://tomcat.apache.org/tomcat-7.0-doc/)

### Installation
## Installation

Please see [RUNNING.txt](RUNNING.txt) for more info.

### Licensing
## Licensing

Please see [LICENSE](LICENSE) for more info.

### Support and Mailing List Information
## Support and Mailing List Information

* Free community support is available through the
[tomcat-users](https://tomcat.apache.org/lists.html#tomcat-users) email list and
Expand All @@ -76,6 +78,6 @@ list.
instructions for reporting a bug
[here](https://tomcat.apache.org/bugreport.html).

### Contributing
## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for more info.
4 changes: 4 additions & 0 deletions modules/stuffed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Configuration is located in `conf/server.xml`, `conf/web.xml`, `conf/logging.pro
### Maven build

Update Tomcat version number in the `pom.xml`, customize Tomcat components in the dependencies to keep the ones needed (only the main `tomcat-catalina` is mandatory). Custom Tomcat components sources can be added to the usual Maven build path and will be included in the package that is built.

```
mvn clean; mvn package
```
Expand All @@ -39,11 +40,13 @@ mvn clean; mvn package
```
docker build -t apache/tomcat-stuffed:1.0 -f ./Dockerfile .
```

Docker build arguments include `namespace` (default is `tomcat`) and `port` which should match the Tomcat port in `server.xml` (default is `8080`). Other ports that need to be exposed can be added in the `Dockerfile` as needed. Webapps should be added to the `webapps` folder where they will be auto deployed by the host if using the defaults. Otherwise, the `Dockerfile` command line can be edited like below to include the necessary resources and command line arguments to run a single or multiple hardcoded web applications.

## Running

Add a webapp as folder mywebapp (for this example, or specify another path), or a path from which a configured Host will auto deploy

```
--path: Specify a path the wepapp will use
--war: Add the spcified path (directory or war) as a webapp (if no path has been specified, it will be the root webapp)
Expand Down Expand Up @@ -74,6 +77,7 @@ An example `tomcat.yaml` is included which uses the Docker image. It uses the he
### Cluster

If using the Kubernetes cloud clustering membership provider, the pod needs to have the permission to view other pods. For example with Openshift, this is done with:

```
oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q)
```
Expand Down
30 changes: 15 additions & 15 deletions modules/stuffed/tomcat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ spec:
run: tomcat
spec:
containers:
- name: tomcat
image: apache/tomcat-stuffed:1.0
ports:
- containerPort: 8080
- containerPort: 8778
name: jolokia
- containerPort: 9404
name: prometheus
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
resources: {}
- name: tomcat
image: apache/tomcat-stuffed:1.0
ports:
- containerPort: 8080
- containerPort: 8778
name: jolokia
- containerPort: 9404
name: prometheus
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 3
periodSeconds: 3
resources: {}
strategy: {}
status: {}
1 change: 0 additions & 1 deletion res/graal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ This directory also contains resource directives, so that resource files normall
also get compiled into the executable image.
These are currently stored in a file called `tomcat-resource.json` in the `META-INF/native-image/groupId/artifactId`
location.