Skip to content

Restore monetdb image, enable log DEBUG #448

Restore monetdb image, enable log DEBUG

Restore monetdb image, enable log DEBUG #448

Workflow file for this run

on:
push:
branches: [ master ]
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
MAVEN_NASHORN: ""
MAVEN_BYTEBUDDY: ""
DOCKER_RESOURCES: ./model/src/test/resources/docker
jobs:
build-jdk11:
name: Test view on Docker (jdk-11)
runs-on: ubuntu-latest
env:
JSQL_DOCKERFILE: 3.8.1-jdk-11-slim
MAVEN_NASHORN: -Dnashorn.args=--no-deprecation-warning
MAVEN_BYTEBUDDY: ""
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Disable shallow clone to prevent Sonar warning
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 18
- name: Set Maven dependencies cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Install Maven dependencies
run: mvn clean install -DskipTests dependency:tree
- name: Build project container
run: docker build -t jsql:latest --build-arg JSQL_DOCKERFILE -f $DOCKER_RESOURCES/Dockerfile.jsql .
- name: Unit tests
run: $DOCKER_RESOURCES/scripts/run-on-docker-no-network.sh 'cd view/ && mvn clean install -P tests'
build:
name: Tests on Docker
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- jdk: 3.8.6-eclipse-temurin-18
nashorn: ""
bytebuddy: ""
- jdk: 3.9.3-eclipse-temurin-20
nashorn: ""
bytebuddy: ""
- jdk: 3.9.7-eclipse-temurin-21
nashorn: ""
bytebuddy: "-Dnet.bytebuddy.experimental=true"
# Groovy not compatible jdk22: gmavenplus-plugin JsonUtilSpock.groovy Unsupported class file major version 66
# - jdk: 3.9.7-eclipse-temurin-22
# nashorn: ""
# bytebuddy: "-Dbytebuddy.experimental=true"
env:
JSQL_DOCKERFILE: ${{ matrix.jdk }}
MAVEN_NASHORN: ${{ matrix.nashorn }}
# experimental enabled on jdk21 to prevent 'Mockito cannot mock this class: class org.jsoup.nodes.Document'
MAVEN_BYTEBUDDY: ${{ matrix.bytebuddy }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Disable shallow clone to prevent Sonar warning
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 18
- name: Set Maven dependencies cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Install Maven dependencies
run: mvn clean install -DskipTests dependency:tree
- name: Run databases and LAMP
run: |
docker-compose -f $DOCKER_RESOURCES/docker-compose.yml build --parallel
docker-compose -f $DOCKER_RESOURCES/docker-compose.yml up -d
- name: List images and containers
run: docker images && docker container ls
- name: Database health checks and configuration
run: |
$DOCKER_RESOURCES/scripts/healthcheck/healthcheck.sh
$DOCKER_RESOURCES/scripts/buff.sh
$DOCKER_RESOURCES/scripts/verify.sh
- name: Build project container
run: docker build -t jsql:latest --build-arg JSQL_DOCKERFILE -f $DOCKER_RESOURCES/Dockerfile.jsql .
- name: Unit and integration tests with Sonar scan
# profile to skipITs/skipTests (env var MAVEN_OPS not working)
# mvn goal site last to apply skin to generated reports
# remove goal pmd:pmd: random StackOverflowError
run: |
$DOCKER_RESOURCES/scripts/run-on-docker.sh '
mvn clean install \
--no-transfer-progress \
-Dorg.slf4j.simpleLogger.log.org.sonarsource.scanner.maven.SonarQubeMojo=error \
-P tests \
sonar:sonar \
org.pitest:pitest-maven:mutationCoverage \
jxr:jxr \
javadoc:javadoc \
surefire-report:report \
surefire-report:failsafe-report-only \
dependency:analyze-report \
spotbugs:check \
versions:dependency-updates-report \
checkstyle:checkstyle \
site
'
- name: Databases statistics
run: $DOCKER_RESOURCES/scripts/verify.sh
- name: Copy files and coverage reports from container
# Sonar scans unmerged reports, Codacy/Codecov requires scanning each files (or reports merged)
run: |
mkdir -p shared-resources/site shared-resources/model shared-resources/view
docker cp docker_jsql-container:target/site/. shared-resources/site
docker cp docker_jsql-container:view/. shared-resources/view
docker cp docker_jsql-container:model/. shared-resources/model
docker cp docker_jsql-container:pom.xml shared-resources
- name: Codecov scan
run: cd shared-resources && bash <(curl -s https://codecov.io/bash) || true
- name: Codacy scan
run: cd shared-resources && bash <(curl -Ls https://coverage.codacy.com/get.sh) || true
- name: Publish coverage
run: |
git checkout docs
git config user.name "Github Actions"
git config user.email no-response@github.com
git pull -s ours # ignore remote changes when updated by parallel jobs
rm -r site/ || echo 'Folder(s) not found'
cp -r "shared-resources/site/." "site/"
for i in view model; do
mkdir -p "site/$i/" && cp -r "shared-resources/$i/target/site/." "site/$i/"
mkdir -p "site/$i/pit-reports/" && cp -r "shared-resources/$i/target/pit-reports/." "site/$i/pit-reports/"
done;
git add -f site/
git commit -m "Publish reports"
git push --force # failed to push some refs
codeql:
name: CodeQL
uses: ./.github/workflows/run-codeql.yml
release:
needs: [build-jdk11, build, codeql]
name: Publish
uses: ./.github/workflows/release.yml
secrets: inherit