Skip to content

Commit c08b028

Browse files
authored
Merge pull request #1642 from Adyen/develop
Release 5.4.0
2 parents ba2264f + c34cb2f commit c08b028

File tree

372 files changed

+13347
-3887
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+13347
-3887
lines changed

.github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[//]: # (If this is a bug fix: include a reproduction path)
55

66
## Checklist <!-- Remove any line that's not applicable -->
7+
- [ ] PR is labelled <!-- Breaking change, Feature, Fix, Dependencies or Chore -->
78
- [ ] Code is unit tested
89
- [ ] Changes are tested manually
9-
- [ ] Link to related issues
10-
- [ ] Add relevant labels to PR <!-- Breaking change, Feature, Fix or Dependencies. If none of these labels are applicable (for example refactor tasks or release PRs) do not use any labels -->
10+
- [ ] Related issues are linked
1111

1212
COAND-XXX

.github/workflows/assemble.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ jobs:
1616
with:
1717
distribution: 'zulu'
1818
java-version: 17
19-
cache: 'gradle'
19+
20+
- name: Gradle cache
21+
uses: gradle/actions/setup-gradle@v3
22+
with:
23+
cache-read-only: false
2024

2125
- name: Grant execute permission for gradlew
2226
run: chmod +x gradlew
2327

2428
- name: Run assembleDebug
25-
run: ./gradlew assDeb --no-daemon
26-
27-
- name: Cache build output
28-
uses: actions/cache/save@v3
29-
with:
30-
path: /home/runner/work/adyen-android/adyen-android
31-
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
29+
run: ./gradlew assDeb -Pstrip-resources=true

.github/workflows/check_develop.yml

+4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13+
assemble:
14+
name: Assemble
15+
uses: ./.github/workflows/assemble.yml
1316
sonar_cloud:
1417
name: SonarCloud
1518
uses: ./.github/workflows/sonar_cloud.yml
19+
needs: assemble
1620
secrets: inherit

.github/workflows/check_labels.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Check Labels
2+
3+
# Every PR should have a label and some labels should include an update to the release notes
4+
on:
5+
pull_request:
6+
branches-ignore:
7+
- 'main'
8+
types: [ synchronize, labeled, unlabeled ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
labels-check:
16+
# https://github.com/actions/virtual-environments/
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Check PR labels
22+
run: |
23+
all_pr_labels_json=$(cat <<EOF
24+
${{ toJson(github.event.pull_request.labels.*.name) }}
25+
EOF
26+
)
27+
all_pr_labels=$(jq -r '.[]' <<< "$all_pr_labels_json")
28+
echo "PR labels: $all_pr_labels"
29+
30+
if [[ "${all_pr_labels[@]}" =~ 'Breaking change' || "${all_pr_labels[@]}" =~ 'Feature' || "${all_pr_labels[@]}" =~ 'Fix' ]]
31+
then
32+
echo "Checking if release notes were added..."
33+
git fetch origin develop --depth 1
34+
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ]
35+
then
36+
echo "Release notes were updated."
37+
exit 0
38+
else
39+
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md"
40+
exit 1
41+
fi
42+
elif [[ "${all_pr_labels[@]}" =~ 'Dependencies' || "${all_pr_labels[@]}" =~ 'Chore' ]]
43+
then
44+
echo "No extra actions needed for used labels"
45+
exit 0
46+
fi
47+
echo "::error::You must add a valid label to this PR"
48+
exit 1

.github/workflows/check_release.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ jobs:
2424
with:
2525
distribution: 'zulu'
2626
java-version: 17
27-
cache: 'gradle'
27+
28+
- name: Gradle cache
29+
uses: gradle/actions/setup-gradle@v3
30+
with:
31+
cache-read-only: true
2832

2933
- name: Grant execute permission for gradlew
3034
run: chmod +x gradlew
3135

3236
# Run gradlew check
3337
- name: Gradle check
34-
run: ./gradlew check --no-daemon
38+
run: ./gradlew check

.github/workflows/check_release_notes.yml

-35
This file was deleted.

.github/workflows/code_analysis.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ jobs:
1616
with:
1717
distribution: 'zulu'
1818
java-version: 17
19-
cache: 'gradle'
19+
20+
- name: Gradle cache
21+
uses: gradle/actions/setup-gradle@v3
22+
with:
23+
cache-read-only: true
2024

2125
- name: Grant execute permission for gradlew
2226
run: chmod +x gradlew
2327

2428
- name: Run detekt
25-
run: ./gradlew detekt --no-daemon
29+
run: ./gradlew detekt -Pstrip-resources=true
2630

2731
ktlint:
2832
name: Run ktlint
@@ -36,10 +40,14 @@ jobs:
3640
with:
3741
distribution: 'zulu'
3842
java-version: 17
39-
cache: 'gradle'
43+
44+
- name: Gradle cache
45+
uses: gradle/actions/setup-gradle@v3
46+
with:
47+
cache-read-only: true
4048

4149
- name: Grant execute permission for gradlew
4250
run: chmod +x gradlew
4351

4452
- name: Run ktlint
45-
run: ./gradlew ktlint --no-daemon
53+
run: ./gradlew ktlint -Pstrip-resources=true

.github/workflows/generate_dependency_graph.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ jobs:
1717
with:
1818
distribution: 'zulu'
1919
java-version: 17
20-
cache: 'gradle'
20+
21+
- name: Gradle cache
22+
uses: gradle/actions/setup-gradle@v3
23+
with:
24+
cache-read-only: true
2125

2226
- name: Setup Graphviz
23-
uses: ts-graphviz/setup-graphviz@v1
27+
uses: ts-graphviz/setup-graphviz@v2
2428

2529
- name: Generate Dependency Graph
2630
run: ./gradlew dependencyGraph

.github/workflows/publish_docs.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,22 @@ jobs:
2323
with:
2424
distribution: 'zulu'
2525
java-version: 17
26-
cache: 'gradle'
26+
27+
- name: Gradle cache
28+
uses: gradle/actions/setup-gradle@v3
29+
with:
30+
cache-read-only: true
2731

2832
- name: Grant execute permission for gradlew
2933
run: chmod +x gradlew
3034

3135
# Generate kdocs
3236
- name: Generate Dokka HTML documentation
33-
run: ./gradlew dokkaHtmlMultiModule --no-daemon
37+
run: ./gradlew dokkaHtmlMultiModule
3438

3539
# Deploy to GitHub Pages
3640
- name: Deploy GitHub Pages
37-
uses: JamesIves/github-pages-deploy-action@v4.5.0
41+
uses: JamesIves/github-pages-deploy-action@v4.6.0
3842
with:
3943
BRANCH: gh-pages
4044
FOLDER: build/docs/

.github/workflows/publish_release.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ jobs:
2121
with:
2222
distribution: 'zulu'
2323
java-version: 17
24-
cache: 'gradle'
25-
24+
25+
- name: Gradle cache
26+
uses: gradle/actions/setup-gradle@v3
27+
with:
28+
cache-read-only: true
29+
2630
- name: Grant execute permission for gradlew
2731
run: chmod +x gradlew
28-
32+
2933
- name: Gradle check
30-
run: ./gradlew check --no-daemon
34+
run: ./gradlew check
3135

3236
# TODO: add more tests or rely on check_release workflow?
3337

@@ -42,7 +46,7 @@ jobs:
4246
4347
# Packages and publishes to Maven Central
4448
- name: Publish to Maven Central
45-
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace --no-daemon
49+
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace
4650
env:
4751
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
4852
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

.github/workflows/run_tests.yml

+8-10
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ jobs:
1616
with:
1717
distribution: 'zulu'
1818
java-version: 17
19-
cache: 'gradle'
2019

21-
- uses: actions/cache/restore@v3
20+
- name: Gradle cache
21+
uses: gradle/actions/setup-gradle@v3
2222
with:
23-
path: /home/runner/work/adyen-android/adyen-android
24-
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
23+
cache-read-only: false
2524

2625
- name: Grant execute permission for gradlew
2726
run: chmod +x gradlew
2827

2928
- name: Run testDebugUnitTest
30-
run: ./gradlew testDebugUnitTest --no-daemon
29+
run: ./gradlew testDebugUnitTest -Pstrip-resources=true
3130

3231
lint:
3332
name: Run lint
@@ -41,15 +40,14 @@ jobs:
4140
with:
4241
distribution: 'zulu'
4342
java-version: 17
44-
cache: 'gradle'
4543

46-
- uses: actions/cache/restore@v3
44+
- name: Gradle cache
45+
uses: gradle/actions/setup-gradle@v3
4746
with:
48-
path: /home/runner/work/adyen-android/adyen-android
49-
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
47+
cache-read-only: false
5048

5149
- name: Grant execute permission for gradlew
5250
run: chmod +x gradlew
5351

5452
- name: Run lintDebug
55-
run: ./gradlew lintDebug --no-daemon
53+
run: ./gradlew lintDebug -Pstrip-resources=true

.github/workflows/run_ui_tests.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: UI Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
workflow_dispatch:
8+
9+
jobs:
10+
ui-test:
11+
name: Run UI tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
# Define the Android version you want to run UI tests for here.
16+
api-level: [ 34 ]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Enable KVM
22+
run: |
23+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
24+
sudo udevadm control --reload-rules
25+
sudo udevadm trigger --name-match=kvm
26+
27+
- name: Set up JDK
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'zulu'
31+
java-version: 17
32+
33+
- name: Gradle cache
34+
uses: gradle/actions/setup-gradle@v3
35+
with:
36+
cache-read-only: false
37+
38+
- name: AVD cache
39+
uses: actions/cache@v4
40+
id: avd-cache
41+
with:
42+
path: |
43+
~/.android/avd/*
44+
~/.android/adb*
45+
key: avd-${{ matrix.api-level }}
46+
47+
- name: Create AVD and generate snapshot for caching
48+
if: steps.avd-cache.outputs.cache-hit != 'true'
49+
uses: reactivecircus/android-emulator-runner@v2
50+
with:
51+
api-level: ${{ matrix.api-level }}
52+
target: google_apis
53+
arch: x86_64
54+
force-avd-creation: false
55+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
56+
disable-animations: false
57+
script: echo "Generated AVD snapshot for caching."
58+
59+
- name: Run connectedDebugAndroidTest
60+
uses: reactivecircus/android-emulator-runner@v2
61+
env:
62+
ADYEN_ANDROID_MERCHANT_SERVER_URL: 'https://android-ui-tests.adyen.com/'
63+
ADYEN_ANDROID_CLIENT_KEY: 'test_fakefakefakefakefakefakefakefake'
64+
with:
65+
api-level: ${{ matrix.api-level }}
66+
target: google_apis
67+
arch: x86_64
68+
force-avd-creation: false
69+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
70+
disable-animations: true
71+
script: ./gradlew connectedDebugAndroidTest -Pstrip-resources=true

0 commit comments

Comments
 (0)