Skip to content

Commit ab59151

Browse files
authored
Merge pull request #246 from hazendaz/master
Build updates
2 parents c0147d5 + 9096669 commit ab59151

File tree

13 files changed

+153
-124
lines changed

13 files changed

+153
-124
lines changed

.github/workflows/ci.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,31 @@ on: [workflow_dispatch, push, pull_request]
44

55
permissions: read-all
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
812
test:
913
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 30
1015
strategy:
1116
matrix:
1217
cache: [maven]
1318
distribution: [temurin]
14-
java: [17, 21, 24, 25-ea]
15-
os: [ubuntu-latest, macos-latest, windows-latest]
19+
java: [21, 25, 26-ea]
20+
os: [macos-latest, ubuntu-latest, windows-latest]
1621
fail-fast: false
17-
max-parallel: 4
22+
max-parallel: 6
1823
name: Test JDK ${{ matrix.java }}, ${{ matrix.os }}
1924

2025
steps:
21-
- uses: actions/checkout@v6
22-
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
23-
uses: actions/setup-java@v5
26+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
27+
- name: Setup Java ${{ matrix.java }} ${{ matrix.distribution }}
28+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
2429
with:
25-
java-version: ${{ matrix.java }}
26-
distribution: ${{ matrix.distribution }}
2730
cache: ${{ matrix.cache }}
31+
distribution: ${{ matrix.distribution }}
32+
java-version: ${{ matrix.java }}
2833
- name: Test with Maven
29-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true"
34+
run: ./mvnw test --batch-mode --no-transfer-progress --show-version -D"license.skip=true"

.github/workflows/codeql.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
- cron: '43 10 * * 2'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
analyze:
17+
name: Analyze
18+
runs-on: 'ubuntu-latest'
19+
timeout-minutes: 30
20+
permissions:
21+
actions: read
22+
contents: read
23+
security-events: write
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
28+
29+
- name: Setup Java
30+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
31+
with:
32+
cache: maven
33+
distribution: 'temurin'
34+
java-version: 25
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4
38+
with:
39+
queries: +security-and-quality
40+
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4
43+
44+
- name: Perform CodeQL Analysis
45+
uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # v4

.github/workflows/codeql.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/coveralls.yaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,33 @@ on: [push, pull_request]
44

55
permissions: read-all
66

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
711
jobs:
8-
build:
12+
coveralls:
913
if: github.repository_owner == 'mybatis'
1014
runs-on: ubuntu-latest
15+
timeout-minutes: 30
1116
steps:
12-
- uses: actions/checkout@v6
13-
- name: Set up JDK
14-
uses: actions/setup-java@v5
17+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
18+
- name: Setup Java
19+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1520
with:
1621
cache: maven
1722
distribution: temurin
18-
java-version: 21
23+
java-version: 25
24+
- name: Run the build
25+
run: ./mvnw test --batch-mode --no-transfer-progress --quiet --show-version -Dlicense.skip=true
1926
- name: Report Coverage to Coveralls for Pull Requests
2027
if: github.event_name == 'pull_request'
21-
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github -DpullRequest=$PR_NUMBER --no-transfer-progress
28+
run: ./mvnw generate-sources jacoco:report coveralls:report --batch-mode --no-transfer-progress -DpullRequest=${{ env.PR_NUMBER }} -DrepoToken=${{ env.GITHUB_TOKEN }} -DserviceName=github
2229
env:
2330
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2431
PR_NUMBER: ${{ github.event.number }}
2532
- name: Report Coverage to Coveralls for General Push
2633
if: github.event_name == 'push'
27-
run: ./mvnw -B -V test jacoco:report coveralls:report -q -Dlicense.skip=true -DrepoToken=$GITHUB_TOKEN -DserviceName=github --no-transfer-progress
34+
run: ./mvnw generate-sources jacoco:report coveralls:report --batch-mode --no-transfer-progress -DrepoToken=${{ env.GITHUB_TOKEN }} -DserviceName=github
2835
env:
2936
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/site.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,30 @@ on:
88
permissions:
99
contents: write
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
build:
1317
if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
1418
runs-on: ubuntu-latest
19+
timeout-minutes: 60
1520
steps:
16-
- uses: actions/checkout@v6
17-
- name: Set up JDK
18-
uses: actions/setup-java@v5
21+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
22+
- name: Setup Java
23+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1924
with:
2025
cache: maven
2126
distribution: temurin
22-
java-version: 21
27+
java-version: 25
2328
- name: Build site
24-
run: ./mvnw site site:stage -DskipTests -Dlicense.skip=true -B -V --no-transfer-progress --settings ./.mvn/settings.xml
29+
run: ./mvnw site site:stage --batch-mode --no-transfer-progress --settings ./.mvn/settings.xml --show-version -Dlicense.skip=true -DskipTests
2530
env:
2631
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2732
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
2833
- name: Deploy Site to gh-pages
29-
uses: JamesIves/github-pages-deploy-action@v4
34+
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4
3035
with:
3136
branch: gh-pages
3237
folder: target/staging

.github/workflows/sonar.yaml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,34 @@ on:
77

88
permissions: read-all
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
SONAR_ORGANIZATION: mybatis
16+
SONAR_PROJECT_KEY: freemarker-scripting
17+
1018
jobs:
1119
build:
1220
if: github.repository_owner == 'mybatis'
1321
runs-on: ubuntu-latest
22+
timeout-minutes: 30
1423
steps:
15-
- uses: actions/checkout@v6
24+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
1625
with:
1726
# Disabling shallow clone is recommended for improving relevancy of reporting
1827
fetch-depth: 0
19-
- name: Set up JDK
20-
uses: actions/setup-java@v5
28+
- name: Setup Java
29+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
2130
with:
2231
cache: maven
2332
distribution: temurin
24-
java-version: 21
33+
java-version: 25
34+
- name: Set SONAR_SCANNER_JAVA_OPTS
35+
run: echo "SONAR_SCANNER_JAVA_OPTS=-Xmx512m" >> ${GITHUB_ENV}
2536
- name: Analyze with SonarCloud
26-
run: ./mvnw verify jacoco:report sonar:sonar -B -V -Dsonar.projectKey=mybatis_freemarker-scripting -Dsonar.organization=mybatis -Dsonar.host.url=https://sonarcloud.io -Dsonar.token=$SONAR_TOKEN -Dlicense.skip=true --no-transfer-progress
37+
run: ./mvnw verify jacoco:report sonar:sonar --batch-mode --no-transfer-progress --show-version -Dlicense.skip=true -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=${{ env.SONAR_ORGANIZATION }} -Dsonar.projectKey=${{ env.SONAR_ORGANIZATION }}_${{ env.SONAR_PROJECT_KEY }} -Dsonar.scanner.skipJreProvisioning=true -Dsonar.token=${{ env.SONAR_TOKEN }}
2738
env:
2839
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2940
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonatype.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ on:
77

88
permissions: read-all
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
build:
1216
if: github.repository_owner == 'mybatis' && ! contains(toJSON(github.event.head_commit.message), '[maven-release-plugin]')
1317
runs-on: ubuntu-latest
18+
timeout-minutes: 30
1419
steps:
15-
- uses: actions/checkout@v6
16-
- name: Set up JDK
17-
uses: actions/setup-java@v5
20+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
21+
- name: Setup Java
22+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1823
with:
1924
cache: maven
2025
distribution: temurin
21-
java-version: 21
26+
java-version: 25
2227
- name: Deploy to Sonatype
23-
run: ./mvnw deploy -DskipTests -B -V --no-transfer-progress --settings ./.mvn/settings.xml -Dlicense.skip=true
28+
run: ./mvnw deploy --batch-mode --no-transfer-progress --settings ./.mvn/settings.xml --show-version -Dlicense.skip=true -DskipTests
2429
env:
2530
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
2631
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}

.mvn/jvm.config

Whitespace-only changes.

.mvn/maven.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-Daether.checksums.algorithms=SHA-512,SHA-256,SHA-1,MD5
22
-Daether.connector.smartChecksums=false
3+
--no-transfer-progress

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@
2525
import java.net.URL;
2626
import java.nio.file.Files;
2727
import java.nio.file.Path;
28-
import java.nio.file.Paths;
2928
import java.nio.file.StandardCopyOption;
3029
import java.util.concurrent.ThreadLocalRandom;
3130

3231
public final class MavenWrapperDownloader {
33-
private static final String WRAPPER_VERSION = "3.3.2";
32+
private static final String WRAPPER_VERSION = "3.3.4";
3433

3534
private static final boolean VERBOSE = Boolean.parseBoolean(System.getenv("MVNW_VERBOSE"));
3635

@@ -45,8 +44,11 @@ public static void main(String[] args) {
4544
try {
4645
log(" - Downloader started");
4746
final URL wrapperUrl = URI.create(args[0]).toURL();
48-
final String jarPath = args[1].replace("..", ""); // Sanitize path
49-
final Path wrapperJarPath = Paths.get(jarPath).toAbsolutePath().normalize();
47+
final Path baseDir = Path.of(".").toAbsolutePath().normalize();
48+
final Path wrapperJarPath = baseDir.resolve(args[1]).normalize();
49+
if (!wrapperJarPath.startsWith(baseDir)) {
50+
throw new IOException("Invalid path: outside of allowed directory");
51+
}
5052
downloadFileFromURL(wrapperUrl, wrapperJarPath);
5153
log("Done");
5254
} catch (IOException e) {

0 commit comments

Comments
 (0)