* tests based on jetty-runner do not work because the jetty-runner JAR contains invalid Java SPI services config files * due to these invalid files Jetty 11.0.20+ is unable to properly initialize itself itself * This change removes all tests based on jetty-runner and bumps the Jetty version to 11.0.24 * There are already jobs using the Jetty Maven plugin to launch a testing instance + run all tests
193 lines
5.2 KiB
YAML
193 lines
5.2 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
jobs:
|
|
test-java-8-war-generation:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: 8
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Remove test code (not java 8 compatible)
|
|
run: rm -rf src/test
|
|
|
|
- name: Generate war file (including apache-jsp artifact)
|
|
run: mvn --batch-mode -f pom.jdk8.xml -D java.net.useSystemProxies=true -Dapache-jsp.scope=compile clean package
|
|
|
|
- name: Generate war file
|
|
run: mvn --batch-mode -f pom.jdk8.xml -D java.net.useSystemProxies=true clean package
|
|
|
|
- name: temporarily save generated files
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: war-jre8
|
|
path: target/plantuml.war
|
|
retention-days: 1
|
|
|
|
test-mvn-livecycle:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
java-version: [ 11, 17 ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: ${{ matrix.java-version }}
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Lifecycle - Step 1/8 - mvn clean
|
|
run: mvn --batch-mode clean
|
|
|
|
- name: Lifecycle - Step 2/8 - mvn validate
|
|
run: mvn --batch-mode validate
|
|
|
|
- name: Lifecycle - Step 3/8 - mvn compile
|
|
run: mvn --batch-mode compile
|
|
|
|
- name: Lifecycle - Step 4/8 - mvn test (with skipTests=true)
|
|
run: mvn --batch-mode test
|
|
|
|
- name: Lifecycle - Step 5/8 - mvn package
|
|
run: mvn --batch-mode package
|
|
|
|
- name: Lifecycle - Step 6/8 - mvn verify
|
|
run: mvn --batch-mode verify
|
|
|
|
- name: Lifecycle - Step 7/8 - mvn install
|
|
run: mvn --batch-mode install
|
|
|
|
- name: Lifecycle - Step 8/8 - mvn site
|
|
run: mvn --batch-mode site
|
|
|
|
test-embedded:
|
|
runs-on: ubuntu-latest
|
|
needs: test-mvn-livecycle
|
|
strategy:
|
|
matrix:
|
|
java-version: [ 11, 17 ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: ${{ matrix.java-version }}
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Run tests against jetty embedded server
|
|
run: mvn --batch-mode clean test -DskipTests=false -Dgroups=\!graphviz-test
|
|
|
|
test-mvn-jetty-run:
|
|
runs-on: ubuntu-latest
|
|
needs: test-mvn-livecycle
|
|
strategy:
|
|
matrix:
|
|
java-version: [ 11, 17 ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: ${{ matrix.java-version }}
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Prepare "mvn jetty:run" tests
|
|
run: mvn --batch-mode clean test
|
|
|
|
- name: Start jetty server over maven
|
|
run: mvn --batch-mode jetty:run &
|
|
|
|
- name: Wait 20 seconds (to let maven start the jetty server)
|
|
run: sleep 20s
|
|
|
|
- name: Run tests against "mvn jetty:run" server
|
|
run: mvn --batch-mode test -DskipTests=false -Dgroups=\!graphviz-test -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|
|
|
|
test-jetty:
|
|
runs-on: ubuntu-latest
|
|
needs: test-mvn-livecycle
|
|
strategy:
|
|
matrix:
|
|
java-version: [ 11, 17 ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: ${{ matrix.java-version }}
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Prepare external tests
|
|
run: mvn --batch-mode clean test
|
|
|
|
- name: Build the jetty docker stack
|
|
run: |
|
|
docker image build -f Dockerfile.jetty -t plantuml-server:local .
|
|
docker run -d --hostname=test.localhost -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
|
|
|
|
- name: Check running containers
|
|
run: docker ps
|
|
|
|
- name: run tests against jetty docker image
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|
|
|
|
test-tomcat:
|
|
runs-on: ubuntu-latest
|
|
needs: test-mvn-livecycle
|
|
strategy:
|
|
matrix:
|
|
java-version: [ 11, 17 ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: ${{ matrix.java-version }}
|
|
check-latest: true
|
|
cache: "maven"
|
|
|
|
- name: Prepare external tests
|
|
run: mvn --batch-mode clean test
|
|
|
|
- name: Build the tomcat docker stack
|
|
run: |
|
|
docker image build -f Dockerfile.tomcat -t plantuml-server:local .
|
|
docker run -d --hostname=test.localhost -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
|
|
|
|
- name: Check running containers
|
|
run: docker ps
|
|
|
|
- name: run tests against tomcat docker image
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|