Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
robtimus committed Sep 12, 2023
0 parents commit 0178753
Show file tree
Hide file tree
Showing 21 changed files with 3,806 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2023 Rob Spoor
#
# 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: Build

on:
workflow_dispatch:
push:
# only run for branches, not tags
branches: ['**']
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [11, 17]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{matrix.java}}
uses: actions/setup-java@v3
with:
java-version: ${{matrix.java}}
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn package --file pom.xml -B --no-transfer-progress

min-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn compile --file pom.xml -B --no-transfer-progress
- name: Test with Maven
run: mvn test --file pom.xml -B --no-transfer-progress -Pmin-versions

site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn package site --file pom.xml -B --no-transfer-progress -DskipTests
26 changes: 26 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2023 Rob Spoor
#
# 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: Dependency Review

on:
pull_request:

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
48 changes: 48 additions & 0 deletions .github/workflows/release-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2023 Rob Spoor
#
# 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: Release site

on:
push:
tags: ['[0-9]+.[0-9]+*']

permissions:
contents: write

jobs:
release-site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Build site
run: |
mvn package site --file pom.xml -B --no-transfer-progress -DskipTests
for i in `grep '<module>.*</module>' pom.xml`; do
module=`echo $i | sed 's~<module>\(.*\)</module>~\1~g'`
echo "Moving site for module $module to target/site"
mv $module/target/site target/site/$module
done
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: 'target/site'
commit-message: 'Updated for version ${{ github.ref_name }}'
clean-exclude: 'apidocs/*.x'
63 changes: 63 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2023 Rob Spoor
#
# 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: SonarCloud

on:
workflow_dispatch:
push:
# only run for branches, not tags
branches: ['**']
pull_request:
schedule:
- cron: '0 6 6 3,9 *'

jobs:
scan:
runs-on: ubuntu-latest
concurrency: sonar-${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: SonarQube Scan
run: |
mvn clean \
-Dcheckstyle.skip=true \
-Dmaven.javadoc.skip=true \
org.jacoco:jacoco-maven-plugin:prepare-agent \
package \
verify -Dgpg.skip=true \
org.jacoco:jacoco-maven-plugin:report \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \
-Dsonar.organization=robtimus-github \
--file pom.xml -B --no-transfer-progress
env:
SONAR_TOKEN: ${{ secrets.SonarCloudToken }}
SONAR_HOST_URL: https://sonarcloud.io
- name: SonarQube Quality Gate check
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SonarCloudToken }}
SONAR_HOST_URL: https://sonarcloud.io
with:
scanMetadataReportFile: target/sonar/report-task.txt
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.settings
.checkstyle
.classpath
.project
src/site/markdown/index.md
target
Loading

0 comments on commit 0178753

Please sign in to comment.