Skip to content

Commit 51c3d2b

Browse files
committed
[gha] Update github actions
1 parent d087f46 commit 51c3d2b

File tree

6 files changed

+74
-37
lines changed

6 files changed

+74
-37
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: [17, 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@v5
22-
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
23-
uses: actions/setup-java@v5
26+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
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.yml renamed to .github/workflows/codeql.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ on:
66
pull_request:
77
branches: [ master ]
88
schedule:
9-
- cron: '27 14 * * 4'
9+
- cron: '43 10 * * 2'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1014

1115
jobs:
1216
analyze:
1317
name: Analyze
14-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
15-
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
18+
runs-on: 'ubuntu-latest'
19+
timeout-minutes: 30
1620
permissions:
1721
actions: read
1822
contents: read
@@ -21,29 +25,29 @@ jobs:
2125
strategy:
2226
fail-fast: false
2327
matrix:
24-
language: [ 'java-kotlin' ]
28+
language: [ javascript, java, kotlin ]
2529

2630
steps:
2731
- name: Checkout
28-
uses: actions/checkout@v5
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2933

3034
- name: Setup Java
31-
uses: actions/setup-java@v5
35+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
3236
with:
3337
cache: maven
3438
distribution: 'temurin'
3539
java-version: 21
3640

3741
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v3
42+
uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3
3943
with:
4044
languages: ${{ matrix.language }}
4145
queries: +security-and-quality
4246

4347
- name: Autobuild
44-
uses: github/codeql-action/autobuild@v3
48+
uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3
4549

4650
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@v3
51+
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3
4852
with:
4953
category: "/language:${{ matrix.language }}"

.github/workflows/coveralls.yaml

Lines changed: 13 additions & 6 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@v5
13-
- name: Set up JDK
14-
uses: actions/setup-java@v5
17+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
18+
- name: Setup Java
19+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1520
with:
1621
cache: maven
1722
distribution: temurin
1823
java-version: 21
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 jacoco:report coveralls:report --batch-mode --no-transfer-progress -DpullRequest=${PR_NUMBER} -DrepoToken=${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 jacoco:report coveralls:report --batch-mode --no-transfer-progress -DrepoToken=${GITHUB_TOKEN} -DserviceName=github
2835
env:
2936
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/site.yaml

Lines changed: 10 additions & 5 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: 30
1520
steps:
16-
- uses: actions/checkout@v5
17-
- name: Set up JDK
18-
uses: actions/setup-java@v5
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
22+
- name: Setup Java
23+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1924
with:
2025
cache: maven
2126
distribution: temurin
2227
java-version: 21
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@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4
3035
with:
3136
branch: gh-pages
3237
folder: target/staging

.github/workflows/sonar.yaml

Lines changed: 15 additions & 4 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: mybatis_cdi
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@v5
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
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
2433
java-version: 21
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_cdi -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=${SONAR_ORGANIZATION} -Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.scanner.skipJreProvisioning=true -Dsonar.token=${SONAR_TOKEN}
2738
env:
2839
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2940
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/sonatype.yaml

Lines changed: 9 additions & 4 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@v5
16-
- name: Set up JDK
17-
uses: actions/setup-java@v5
20+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
21+
- name: Setup Java
22+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5
1823
with:
1924
cache: maven
2025
distribution: temurin
2126
java-version: 21
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 }}

0 commit comments

Comments
 (0)