Skip to content

Commit

Permalink
Merge pull request #1642 from Adyen/develop
Browse files Browse the repository at this point in the history
Release 5.4.0
  • Loading branch information
OscarSpruit authored May 30, 2024
2 parents ba2264f + c34cb2f commit c08b028
Show file tree
Hide file tree
Showing 372 changed files with 13,347 additions and 3,887 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[//]: # (If this is a bug fix: include a reproduction path)

## Checklist <!-- Remove any line that's not applicable -->
- [ ] PR is labelled <!-- Breaking change, Feature, Fix, Dependencies or Chore -->
- [ ] Code is unit tested
- [ ] Changes are tested manually
- [ ] Link to related issues
- [ ] 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 -->
- [ ] Related issues are linked

COAND-XXX
14 changes: 6 additions & 8 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false

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

- name: Run assembleDebug
run: ./gradlew assDeb --no-daemon

- name: Cache build output
uses: actions/cache/save@v3
with:
path: /home/runner/work/adyen-android/adyen-android
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
run: ./gradlew assDeb -Pstrip-resources=true
4 changes: 4 additions & 0 deletions .github/workflows/check_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ concurrency:
cancel-in-progress: true

jobs:
assemble:
name: Assemble
uses: ./.github/workflows/assemble.yml
sonar_cloud:
name: SonarCloud
uses: ./.github/workflows/sonar_cloud.yml
needs: assemble
secrets: inherit
48 changes: 48 additions & 0 deletions .github/workflows/check_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Check Labels

# Every PR should have a label and some labels should include an update to the release notes
on:
pull_request:
branches-ignore:
- 'main'
types: [ synchronize, labeled, unlabeled ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
labels-check:
# https://github.com/actions/virtual-environments/
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check PR labels
run: |
all_pr_labels_json=$(cat <<EOF
${{ toJson(github.event.pull_request.labels.*.name) }}
EOF
)
all_pr_labels=$(jq -r '.[]' <<< "$all_pr_labels_json")
echo "PR labels: $all_pr_labels"
if [[ "${all_pr_labels[@]}" =~ 'Breaking change' || "${all_pr_labels[@]}" =~ 'Feature' || "${all_pr_labels[@]}" =~ 'Fix' ]]
then
echo "Checking if release notes were added..."
git fetch origin develop --depth 1
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ]
then
echo "Release notes were updated."
exit 0
else
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md"
exit 1
fi
elif [[ "${all_pr_labels[@]}" =~ 'Dependencies' || "${all_pr_labels[@]}" =~ 'Chore' ]]
then
echo "No extra actions needed for used labels"
exit 0
fi
echo "::error::You must add a valid label to this PR"
exit 1
8 changes: 6 additions & 2 deletions .github/workflows/check_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

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

# Run gradlew check
- name: Gradle check
run: ./gradlew check --no-daemon
run: ./gradlew check
35 changes: 0 additions & 35 deletions .github/workflows/check_release_notes.yml

This file was deleted.

16 changes: 12 additions & 4 deletions .github/workflows/code_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

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

- name: Run detekt
run: ./gradlew detekt --no-daemon
run: ./gradlew detekt -Pstrip-resources=true

ktlint:
name: Run ktlint
Expand All @@ -36,10 +40,14 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

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

- name: Run ktlint
run: ./gradlew ktlint --no-daemon
run: ./gradlew ktlint -Pstrip-resources=true
8 changes: 6 additions & 2 deletions .github/workflows/generate_dependency_graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
uses: ts-graphviz/setup-graphviz@v2

- name: Generate Dependency Graph
run: ./gradlew dependencyGraph
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,22 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

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

# Generate kdocs
- name: Generate Dokka HTML documentation
run: ./gradlew dokkaHtmlMultiModule --no-daemon
run: ./gradlew dokkaHtmlMultiModule

# Deploy to GitHub Pages
- name: Deploy GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
BRANCH: gh-pages
FOLDER: build/docs/
14 changes: 9 additions & 5 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'


- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: true

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

- name: Gradle check
run: ./gradlew check --no-daemon
run: ./gradlew check

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

Expand All @@ -42,7 +46,7 @@ jobs:
# Packages and publishes to Maven Central
- name: Publish to Maven Central
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace --no-daemon
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

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

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

- name: Run testDebugUnitTest
run: ./gradlew testDebugUnitTest --no-daemon
run: ./gradlew testDebugUnitTest -Pstrip-resources=true

lint:
name: Run lint
Expand All @@ -41,15 +40,14 @@ jobs:
with:
distribution: 'zulu'
java-version: 17
cache: 'gradle'

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

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

- name: Run lintDebug
run: ./gradlew lintDebug --no-daemon
run: ./gradlew lintDebug -Pstrip-resources=true
71 changes: 71 additions & 0 deletions .github/workflows/run_ui_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: UI Tests

on:
push:
branches:
- 'develop'
workflow_dispatch:

jobs:
ui-test:
name: Run UI tests
runs-on: ubuntu-latest
strategy:
matrix:
# Define the Android version you want to run UI tests for here.
api-level: [ 34 ]

steps:
- uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run connectedDebugAndroidTest
uses: reactivecircus/android-emulator-runner@v2
env:
ADYEN_ANDROID_MERCHANT_SERVER_URL: 'https://android-ui-tests.adyen.com/'
ADYEN_ANDROID_CLIENT_KEY: 'test_fakefakefakefakefakefakefakefake'
with:
api-level: ${{ matrix.api-level }}
target: google_apis
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedDebugAndroidTest -Pstrip-resources=true
Loading

0 comments on commit c08b028

Please sign in to comment.