2021-10-12 15:51:35 +00:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
2021-10-15 13:11:55 +00:00
|
|
|
test-java-8-war-generation:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
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@v2
|
|
|
|
with:
|
|
|
|
name: war-jre8
|
|
|
|
path: target/plantuml.war
|
|
|
|
retention-days: 1
|
|
|
|
|
|
|
|
test-java-8-war:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: test-java-8-war-generation
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: retrieve generated files (jre8)
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: war-jre8
|
|
|
|
path: artifacts
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
|
|
|
- name: Prepare jetty-runner tests
|
|
|
|
run: mvn --batch-mode clean package
|
|
|
|
|
|
|
|
- name: Start jetty server over jetty-runner
|
|
|
|
run: java -jar target/dependency/jetty-runner.jar --config src/main/config/jetty.xml --path /plantuml artifacts/plantuml.war &
|
|
|
|
|
|
|
|
- name: Wait 5 seconds (to let jetty-runner start the jetty server)
|
|
|
|
run: sleep 5s
|
|
|
|
|
|
|
|
- name: Run tests against "mvn jetty:run" server
|
|
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|
|
|
|
|
2021-10-12 15:51:35 +00:00
|
|
|
test-mvn-livecycle:
|
|
|
|
runs-on: ubuntu-latest
|
2021-10-15 13:11:55 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
2021-10-12 15:51:35 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
2021-10-12 15:51:35 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
|
|
|
- name: Lifecycle - Step 1/8 - mvn clean
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode clean
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 2/8 - mvn validate
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode validate
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 3/8 - mvn compile
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode compile
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 4/8 - mvn test (with skipTests=true)
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode test
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 5/8 - mvn package
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode package
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 6/8 - mvn verify
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode verify
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 7/8 - mvn install
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode install
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Lifecycle - Step 8/8 - mvn site
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode site
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
test-embedded:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: test-mvn-livecycle
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: Run tests against jetty embedded server
|
|
|
|
run: mvn --batch-mode clean test -DskipTests=false
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
test-mvn-jetty-run:
|
2021-10-12 15:51:35 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: test-mvn-livecycle
|
2021-10-15 13:11:55 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
2021-10-12 15:51:35 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
2021-10-12 15:51:35 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: Prepare "mvn jetty:run" tests
|
|
|
|
run: mvn --batch-mode clean test
|
|
|
|
|
|
|
|
- name: Start jetty server over maven
|
|
|
|
run: mvn --batch-mode jetty:run &
|
|
|
|
|
2021-10-17 13:45:10 +00:00
|
|
|
- name: Wait 20 seconds (to let maven start the jetty server)
|
|
|
|
run: sleep 20s
|
2021-10-15 13:11:55 +00:00
|
|
|
|
|
|
|
- name: Run tests against "mvn jetty:run" server
|
|
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|
|
|
|
|
|
|
|
test-jetty-runner:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: test-mvn-livecycle
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
2021-10-12 15:51:35 +00:00
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: Prepare jetty-runner tests
|
|
|
|
run: mvn --batch-mode clean package
|
|
|
|
|
|
|
|
- name: Start jetty server over jetty-runner
|
|
|
|
run: java -jar target/dependency/jetty-runner.jar --config src/main/config/jetty.xml --path /plantuml target/plantuml.war &
|
|
|
|
|
|
|
|
- name: Wait 5 seconds (to let jetty-runner start the jetty server)
|
|
|
|
run: sleep 5s
|
|
|
|
|
|
|
|
- name: Run tests against "mvn jetty:run" server
|
|
|
|
run: mvn --batch-mode test -DskipTests=false -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@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
|
|
|
- name: Prepare external tests
|
|
|
|
run: mvn --batch-mode clean test
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Build the jetty docker stack
|
|
|
|
run: |
|
|
|
|
docker image build -f Dockerfile.jetty -t plantuml-server:local .
|
|
|
|
docker run -d -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
|
|
|
|
|
|
|
|
- name: Check running containers
|
|
|
|
run: docker ps
|
|
|
|
|
|
|
|
- name: run tests against jetty docker image
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
test-tomcat:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: test-mvn-livecycle
|
2021-10-15 13:11:55 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java-version: [ 11, 17 ]
|
2021-10-12 15:51:35 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- uses: actions/setup-java@v2
|
|
|
|
with:
|
2021-10-15 13:11:55 +00:00
|
|
|
distribution: "zulu"
|
|
|
|
java-version: ${{ matrix.java-version }}
|
2021-10-12 15:51:35 +00:00
|
|
|
check-latest: true
|
|
|
|
cache: "maven"
|
|
|
|
|
2021-10-15 13:11:55 +00:00
|
|
|
- name: Prepare external tests
|
|
|
|
run: mvn --batch-mode clean test
|
2021-10-12 15:51:35 +00:00
|
|
|
|
|
|
|
- name: Build the tomcat docker stack
|
|
|
|
run: |
|
|
|
|
docker image build -f Dockerfile.tomcat -t plantuml-server:local .
|
|
|
|
docker run -d -p 8080:8080 -e BASE_URL=plantuml plantuml-server:local
|
|
|
|
|
|
|
|
- name: Check running containers
|
|
|
|
run: docker ps
|
|
|
|
|
|
|
|
- name: run tests against tomcat docker image
|
2021-10-15 13:11:55 +00:00
|
|
|
run: mvn --batch-mode test -DskipTests=false -DargLine="-Dsystem.test.server=http://localhost:8080/plantuml"
|