Skip to content

Commit c2ee63c

Browse files
authored
Merge pull request #13892 from SORMAS-Foundation/task-update_github_actions
Updated github actions and app barcode library version
2 parents 2100265 + 80ddc91 commit c2ee63c

File tree

8 files changed

+57
-66
lines changed

8 files changed

+57
-66
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@ name: Java CI with Maven
77

88
env:
99
JAVA: 17
10-
PRIVILEGED_RUN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/development')
11-
|| github.event.pull_request.head.repo.full_name == github.repository }}
12-
CODEQL_LANGUAGES: 'java' # FIXME(@JonasCir) add 'javascript'
10+
PRIVILEGED_RUN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/development') || github.event.pull_request.head.repo.full_name == github.repository }}
11+
CODEQL_LANGUAGES: 'java'
1312
on:
1413
push:
1514
branches: [ development, master, hotfix* ]
1615
pull_request:
1716
branches: [ development, hotfix* ]
1817
workflow_dispatch: # run it manually from the GH Actions web console
18+
inputs:
19+
skip_tests:
20+
description: 'Skip Maven tests during build'
21+
required: false
22+
default: false
23+
type: boolean
1924
schedule:
2025
- cron: '35 1 * * 0'
2126
jobs:
@@ -31,24 +36,24 @@ jobs:
3136
# The token is only needed for privileged actions from within the repo, so no need
3237
# to make it available on 3rd party PRs
3338
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
34-
uses: actions/checkout@v3
39+
uses: actions/checkout@v6
3540
with:
36-
token: ${{ secrets.SORMAS_VITAGROUP_CI_TOKEN }}
41+
token: ${{ secrets.MAVEN_ACTIONS_TOKEN }}
3742

3843
- name: Checkout repository (without token)
3944
# Check if PR results from a fork: if yes, we cannot access the token.
4045
# The token is only needed for privileged actions from within the
4146
# repo, so no need to make it available on 3rd party PRs
4247
if: ${{ !fromJSON(env.PRIVILEGED_RUN) }}
43-
uses: actions/checkout@v3
48+
uses: actions/checkout@v6
4449

4550
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
51+
uses: github/codeql-action/init@v4
4752
with:
4853
languages: ${{ env.CODEQL_LANGUAGES }}
4954

5055
- name: Set up JDK ${{ env.JAVA }}
51-
uses: actions/setup-java@v3
56+
uses: actions/setup-java@v5
5257
with:
5358
java-version: ${{ env.JAVA }}
5459
distribution: 'zulu'
@@ -57,47 +62,26 @@ jobs:
5762
# Check if PR results from the repository: if yes, it is safe to cache dependencies.
5863
# This is to keep us safe from cache poisoning through 3rd party PRs.
5964
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
60-
uses: actions/cache@v3
65+
uses: actions/cache@v5
6166
with:
6267
path: ~/.m2
6368
key: ${{ runner.os }}-java-${{ env.JAVA }}-m2-${{ hashFiles('**/pom.xml') }}
6469
restore-keys: ${{ runner.os }}-java-${{ env.JAVA }}-m2
6570

66-
- name: Cache SonarCloud packages
67-
# Check if PR results from the repository: if yes, it is safe to cache dependencies.
68-
# This is to keep us safe from cache poisoning through 3rd party PRs.
69-
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
70-
uses: actions/cache@v3
71-
with:
72-
path: ~/.sonar/cache
73-
key: ${{ runner.os }}-sonar
74-
restore-keys: ${{ runner.os }}-sonar
75-
- name: Run mvn verify and sonar analysis
76-
# FIXME(@JonasCir) see https://github.com/sormas-foundation/SORMAS-Project/issues/3730#issuecomment-745165678
77-
env:
78-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
79-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
71+
- name: Build with Maven
8072
working-directory: ./sormas-base
81-
run: mvn -B -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=SORMAS-Project
82-
83-
- name: Comment with SonarCloud analysis
84-
uses: actions/github-script@v6
85-
if: github.event_name == 'pull_request'
86-
with:
87-
github-token: ${{ secrets.SORMAS_VITAGROUP_CI_TOKEN }}
88-
script: |
89-
github.rest.issues.createComment({
90-
issue_number: context.issue.number,
91-
owner: context.repo.owner,
92-
repo: context.repo.repo,
93-
body: `SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=${{ github.event.pull_request.number }}`
94-
})
73+
run: |
74+
MAVEN_OPTS="-B -ntp clean install"
75+
if [ "${{ inputs.skip_tests }}" = "true" ]; then
76+
MAVEN_OPTS="$MAVEN_OPTS -DskipTests"
77+
fi
78+
mvn $MAVEN_OPTS
9579
9680
- name: Perform CodeQL Analysis
97-
uses: github/codeql-action/analyze@v2
81+
uses: github/codeql-action/analyze@v4
9882

9983
- name: Run Trivy vulnerability scanner in repo mode
100-
uses: aquasecurity/trivy-action@0.11.2
84+
uses: aquasecurity/trivy-action@0.35.0
10185
with:
10286
scan-type: 'fs'
10387
ignore-unfixed: true
@@ -106,7 +90,7 @@ jobs:
10690
scanners: 'vuln,secret,config'
10791

10892
- name: Upload Trivy scan results to GitHub Security tab
109-
uses: github/codeql-action/upload-sarif@v2
93+
uses: github/codeql-action/upload-sarif@v4
11094
with:
11195
sarif_file: 'trivy-results.sarif'
11296
# needed as codeQL also performs an upload, and they clash otherwise
@@ -115,12 +99,11 @@ jobs:
11599
- name: Commit openAPI spec to development
116100
# Privileged action needing a secret token. Since this only runs on development in our own repo
117101
# the token will be available through a privileged checkout.
118-
if: github.event_name == 'push' && github.ref == 'refs/heads/development'
119-
&& hashFiles('sormas-rest/target/swagger.yaml') != hashFiles('sormas-rest/swagger.yaml')
102+
if: github.event_name == 'push' && github.ref == 'refs/heads/development' && hashFiles('sormas-rest/target/swagger.yaml') != hashFiles('sormas-rest/swagger.yaml')
120103
# https://stackoverflow.com/questions/59604922/authorize-bash-to-access-github-protected-branch
121104
run: |
122-
git config --global user.name "sormas-vitagroup"
123-
git config --global user.email "support.sormas@helpdesk.symeda.de"
105+
git config --global user.name "sormas-robot"
106+
git config --global user.email "accounts@sormas.org"
124107
125108
mkdir /tmp/openapi
126109
cp sormas-rest/target/swagger.* /tmp/openapi

.github/workflows/dependency-review.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: 'Checkout Repository'
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v6
1313
- name: 'Dependency Review'
14-
uses: actions/dependency-review-action@v3
14+
uses: actions/dependency-review-action@v4

.github/workflows/github_pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout development
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v6
1515
- name: Copy files
1616
run: |
1717
cp README.md docs/index.md

.github/workflows/gradle_wrapper_validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout repository (without token)
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v6
1515

1616
- name: Validate gradle wrapper
17-
uses: gradle/wrapper-validation-action@v1
17+
uses: gradle/actions/wrapper-validation@v5

.github/workflows/linter.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ name: Lint Code Base
1616
#############################
1717
on:
1818
workflow_dispatch:
19-
pull_request:
20-
branches: [development, hotfix*]
19+
# Disabled auto for now until linting errors are fixed
20+
# pull_request:
21+
# branches: [development, hotfix*]
2122

2223
###############
2324
# Set the Job #
@@ -37,7 +38,7 @@ jobs:
3738
# Checkout the code base #
3839
##########################
3940
- name: Checkout Code
40-
uses: actions/checkout@v3
41+
uses: actions/checkout@v6
4142
with:
4243
# Full git history is needed to get a proper list of changed files within `super-linter`
4344
fetch-depth: 0
@@ -46,7 +47,7 @@ jobs:
4647
# Run Linter against code base #
4748
################################
4849
- name: Lint Code Base
49-
uses: github/super-linter/slim@v5
50+
uses: github/super-linter/slim@v6
5051
env:
5152
DEFAULT_BRANCH: development
5253
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/openapi_canary.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22
name: OpenAPI Canary
33

44
on:
5-
schedule:
5+
workflow_dispatch:
6+
inputs:
7+
reason:
8+
description: 'Reason for manual run'
9+
required: false
10+
default: 'Testing on specific branch'
11+
# Disabled until fixing the issue with the diff tool
12+
# schedule:
613
# 2.30 UTC
7-
- cron: '30 2 * * *'
14+
# - cron: '30 2 * * *'
815

916
jobs:
1017
canary:
@@ -14,12 +21,12 @@ jobs:
1421

1522
steps:
1623
- name: Checkout development branch
17-
uses: actions/checkout@v3
24+
uses: actions/checkout@v6
1825
with:
1926
path: head
2027

2128
- name: Checkout master branch
22-
uses: actions/checkout@v3
29+
uses: actions/checkout@v6
2330
with:
2431
ref: master
2532
path: base

.github/workflows/sormas_app_ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# The token is only needed for privileged actions from within the repo, so no need
4242
# to make it available on 3rd party PRs
4343
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@v6
4545
with:
4646
token: ${{ secrets.SORMAS_VITAGROUP_CI_TOKEN }}
4747

@@ -50,10 +50,10 @@ jobs:
5050
# The token is only needed for privileged actions from within the repo, so no need
5151
# to make it available on 3rd party PRs
5252
if: ${{ !fromJSON(env.PRIVILEGED_RUN) }}
53-
uses: actions/checkout@v3
53+
uses: actions/checkout@v6
5454

5555
- name: Set up JDK ${{ env.JAVA }}
56-
uses: actions/setup-java@v3
56+
uses: actions/setup-java@v5
5757
with:
5858
java-version: ${{ env.JAVA }}
5959
distribution: 'zulu'
@@ -62,7 +62,7 @@ jobs:
6262
# Check if PR results from the repository: if yes, it is safe to cache dependencies.
6363
# This is to keep us safe from cache poisoning through 3rd party PRs.
6464
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
65-
uses: actions/cache@v3
65+
uses: actions/cache@v5
6666
with:
6767
path: ~/.m2
6868
key: ${{ runner.os }}-java-${{ env.JAVA }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -73,7 +73,7 @@ jobs:
7373
run: mvn install -pl :sormas-api -am -DskipTests=true
7474

7575
- name: Cache Gradle packages
76-
uses: actions/cache@v3
76+
uses: actions/cache@v5
7777
# Check if PR results from the repository: if yes, it is safe to cache dependencies.
7878
# This is to keep us safe from cache poisoning through 3rd party PRs.
7979
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
@@ -93,7 +93,7 @@ jobs:
9393
# Check if PR results from the repository: if yes, it is safe to cache dependencies.
9494
# This is to keep us safe from cache poisoning through 3rd party PRs.
9595
if: ${{ fromJSON(env.PRIVILEGED_RUN) }}
96-
uses: actions/cache@v3
96+
uses: actions/cache@v5
9797
id: avd-cache
9898
with:
9999
path: |
@@ -122,12 +122,12 @@ jobs:
122122
script: ./gradlew connectedAndroidTest
123123

124124
- name: mobsfscan
125-
uses: MobSF/mobsfscan@0.2.0
125+
uses: MobSF/mobsfscan@main
126126
with:
127127
args: '. --sarif --output mobsf-results.sarif || true'
128128

129129
- name: Upload mobsfscan report
130-
uses: github/codeql-action/upload-sarif@v2
130+
uses: github/codeql-action/upload-sarif@v4
131131
with:
132132
sarif_file: 'mobsf-results.sarif'
133133
# needed as codeQL also performs an upload, and they clash otherwise

sormas-app/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ dependencies {
134134
implementation 'androidx.paging:paging-runtime:3.1.1'
135135
implementation 'androidx.work:work-runtime-ktx:2.8.1'
136136
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
137-
implementation 'me.dm7.barcodescanner:zxing:1.9.13'
137+
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
138138
implementation 'io.crowdcode.sormas.lbds:lbds-android-messaging:1.4.8'
139139
implementation 'org.slf4j:slf4j-api:2.0.7'
140140
// Align versions of all Kotlin components

0 commit comments

Comments
 (0)