Skip to content

Commit

Permalink
Update dependencies (#71)
Browse files Browse the repository at this point in the history
* Delete eclipse config files

* Update dependencies

* Fix sonar build

* Disable Java 17 & 21 for now

* Add sonar binding

* Fix sonar build

* Rename build step

---------

Co-authored-by: kaklakariada <kaklakariada@users.noreply.github.com>
  • Loading branch information
kaklakariada and kaklakariada committed Jan 28, 2024
1 parent 2625db5 commit 2186be9
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 94 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/build-next-java.yml

This file was deleted.

41 changes: 26 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,54 @@ on:
branches: [ main ]

jobs:
build:

matrix-build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
java: [11] # 17 & 21 removed because of https://github.com/itsallcode/junit5-system-extensions/issues/68
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}-java-${{ matrix.java }}
cancel-in-progress: true
env:
DEFAULT_JAVA: 11

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 11
distribution: 'temurin'
java-version: |
11
17
21
cache: maven
- name: Cache SonarQube packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Build with Maven
run: mvn --errors --batch-mode clean install
env:
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: Build with Java ${{ matrix.java }}
run: mvn --errors --batch-mode clean install -Djava.version=${{ matrix.java }}
- name: Sonar analysis
if: ${{ env.SONAR_TOKEN != null }}
run: mvn --errors --batch-mode -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=itsallcode -Dsonar.login=$SONAR_TOKEN org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar
if: ${{ env.DEFAULT_JAVA == matrix.java && env.SONAR_TOKEN != null }}
run: mvn --errors --batch-mode -Dsonar.token=$SONAR_TOKEN org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
MAVEN_OPTS: "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: ${{ always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]' }}
with:
report_paths: '**/target/surefire-reports/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}

build:
needs: matrix-build
runs-on: ubuntu-latest
steps:
- run: echo "Build successful"
14 changes: 6 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 4 * * 3'

jobs:
analyze:
Expand All @@ -20,21 +18,21 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: 11
cache: maven

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: java

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
**/*.out
/target
/bin
/.settings/org.eclipse.core.resources.prefs
/.settings/org.eclipse.jdt.apt.core.prefs
/.settings/org.eclipse.m2e.core.prefs
6 changes: 0 additions & 6 deletions .settings/org.eclipse.core.resources.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.generate.finalModifiers": "explicit",
"source.fixAll": "explicit"
},
"java.saveActions.organizeImports": true,
"java.sources.organizeImports.starThreshold": 3,
"java.sources.organizeImports.staticStarThreshold": 3,
"java.configuration.updateBuildConfiguration": "automatic",
"sonarlint.connectedMode.project": {
"connectionId": "itsallcode",
"projectKey": "org.itsallcode:junit5-system-extensions"
}
}
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ The list below show all build time dependencies in alphabetical order. Note that

```bash
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=itsallcode \
-Dsonar.login=[token]
-Dsonar.token=[token]
```

See analysis results at https://sonarcloud.io/dashboard?id=org.itsallcode%3Ajunit5-system-extensions
Expand Down
53 changes: 32 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@
</scm>
<properties>
<java.version>11</java.version>
<junit.version>5.9.0</junit.version>
<junit.platform.version>1.9.0</junit.platform.version>
<junit.version>5.10.1</junit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipSigningArtifacts>true</skipSigningArtifacts>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>itsallcode</sonar.organization>
</properties>
<prerequisites>
<maven>3.6.3</maven>
</prerequisites>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
Expand All @@ -66,25 +64,38 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>${junit.platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.7.0</version>
<version>5.10.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>${java.version}</version>
</jdk>
</toolchains>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.12.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
Expand All @@ -93,7 +104,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -106,7 +117,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -130,7 +141,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.11</version>
<executions>
<execution>
<goals>
Expand All @@ -148,12 +159,12 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -170,7 +181,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand All @@ -186,7 +197,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<version>3.4.1</version>
<executions>
<execution>
<id>enforce-maven</id>
Expand All @@ -206,7 +217,7 @@
<plugin>
<groupId>io.github.zlika</groupId>
<artifactId>reproducible-build-maven-plugin</artifactId>
<version>0.15</version>
<version>0.16</version>
<executions>
<execution>
<id>strip-jar</id>
Expand Down

0 comments on commit 2186be9

Please sign in to comment.