Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

GH actions (EXPOSUREAPP-13085) #5216

Merged
merged 59 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e63d7c4
Create android.yml
mtwalli May 13, 2022
348a0d7
No specific distribution
mtwalli May 13, 2022
b86e377
Update android.yml
mtwalli May 13, 2022
b119062
Cancel on progress
mtwalli May 13, 2022
ee8b8ed
Update android.yml
mtwalli May 13, 2022
f685a75
Merge branch 'release/2.23.x' into feature/13085-GH-actions
mtwalli May 13, 2022
75af27e
on `push` only
mtwalli May 13, 2022
d7fa350
Merge branch 'feature/13085-GH-actions' of https://github.com/corona-…
mtwalli May 13, 2022
df20bbc
Reusable actions
mtwalli May 13, 2022
3e5fe4a
Run jobs
mtwalli May 13, 2022
91ac60f
Fix
mtwalli May 13, 2022
c15ab43
Reports
mtwalli May 13, 2022
c8ecca7
run 🏃‍♂️ `always`
mtwalli May 14, 2022
b3cae0d
try matrix
mtwalli May 14, 2022
244de68
Fix syntax
mtwalli May 14, 2022
51363ff
inline options
mtwalli May 14, 2022
3133e5e
Disable
mtwalli May 14, 2022
de4d4da
Disable right class
mtwalli May 15, 2022
1816153
Remove `-i`
mtwalli May 15, 2022
a20eb03
Shorten
mtwalli May 15, 2022
f43bed0
Options
mtwalli May 15, 2022
e8bab82
Gradle `properties`
mtwalli May 15, 2022
57609ae
Update android.yml
mtwalli May 15, 2022
c88f832
Sort
mtwalli May 15, 2022
cb58f61
Update ci-gradle.properties
mtwalli May 15, 2022
ccd81b5
Create build_and_test.yml
kaddaSz May 20, 2022
7463798
Create ReleaseCandidate.yml
kaddaSz May 20, 2022
7d68e12
Delete android.yml
kaddaSz May 20, 2022
742f77f
Update build_and_test.yml
kaddaSz May 20, 2022
91c2477
Merge branch 'release/2.23.x' into feature/13085-GH-actions
mtwalli May 23, 2022
4757cc4
Sonar
mtwalli May 23, 2022
d7d58f3
Merge branch 'release/2.23.x' into feature/13085-GH-actions
mtwalli May 23, 2022
79bc433
Update build_and_test.yml
mtwalli May 23, 2022
2dfca8f
Merge branch 'release/2.23.x' into feature/13085-GH-actions
mtwalli May 23, 2022
e95e353
Revert "Update build_and_test.yml"
mtwalli May 23, 2022
2a2a657
Run sonar
mtwalli May 23, 2022
7d61185
`Push` only
mtwalli May 23, 2022
5b8e880
Remove `build` task
mtwalli May 23, 2022
6dabae4
Sonar properties
mtwalli May 23, 2022
a887546
Remove env key
mtwalli May 23, 2022
4465c5d
Refer to env var
mtwalli May 23, 2022
2ba7afe
gradle ci properties
mtwalli May 23, 2022
705819c
`--info`
mtwalli May 23, 2022
3105587
remove duplicate
mtwalli May 23, 2022
6045a40
key
mtwalli May 23, 2022
61ea0a0
Merge branch 'release/2.23.x' into feature/13085-GH-actions
mtwalli May 24, 2022
0b10b69
Tech dept P2 (EXPOSUREAPP-13177) (#5225)
mtwalli May 24, 2022
a91f623
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli May 24, 2022
69b90b5
Pay technical dept of AppConfig (EXPOSUREAPP-13168) (#5224)
mtwalli May 25, 2022
7294895
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli May 25, 2022
fcfeace
Merge branch 'release/2.24.x' into feature/13085-GH-actions
marcauberer May 26, 2022
9a50114
Tech dept P3 (#5232)
mtwalli May 27, 2022
3aeafd5
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli May 27, 2022
3362a11
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli May 30, 2022
ec84673
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli Jun 1, 2022
486fb38
Enable test
mtwalli Jun 1, 2022
b3fd91b
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli Jun 1, 2022
f8c4a6e
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli Jun 1, 2022
feae20e
Merge branch 'release/2.24.x' into feature/13085-GH-actions
mtwalli Jun 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
org.gradle.daemon=false
org.gradle.caching=true
org.gradle.parallel=true
kotlin.incremental=false
org.gradle.workers.max=2
org.gradle.configureondemand=true
kotlin.compiler.execution.strategy=in-process
org.gradle.jvmargs=-Xmx5120m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError
217 changes: 217 additions & 0 deletions .github/workflows/ReleaseCandidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
name: Create Release Candidate

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

env:
JVM_OPTS: -Xmx4096m
GRADLE_OPTS: |
-Xmx1536m -XX:+HeapDumpOnOutOfMemoryError
-Dorg.gradle.caching=true
-Dorg.gradle.configureondemand=true
-Dkotlin.compiler.execution.strategy=in-process
-Dkotlin.incremental=false

jobs:
dependencies:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Download sapmachine JDK 11
run: |
download_url="https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.14.1/sapmachine-jdk-11.0.14.1_linux-x64_bin.tar.gz"
wget -O "${RUNNER_TEMP}/sapmachine-jdk-11.tar.gz" "${download_url}"

- name: Setup sapmachine JDK 11
uses: actions/setup-java@v2
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/sapmachine-jdk-11.tar.gz
java-version: '11.0.14'
architecture: x64
cache: 'gradle'

- uses: maxim-lobanov/setup-android-tools@v1
with:
cache: true

quick_build_device_for_testers_signed:
runs-on: ubuntu-latest
needs: dependencies
env:
keystore_download_token: '${{ secrets.KEYSTORE_DOWNLOAD_TOKEN }}'
keystore_download_url: '${{ secrets.KEYSTORE_DOWNLOAD_URL }}'
keystore_download_filename: '${{ secrets.KEYSTORE_DOWNLOAD_FILENAME }}'
environments_download_url: '${{ secrets.ENVIRONMENTS_DOWNLOAD_URL }}'
env_prop_download_filename: '${{ secrets.ENV_PROP_DOWNLOAD_FILENAME }}'
keystore_filename: '${{ secrets.KEYSTORE_FILENAME }}'
keystore_encrypt_key: '${{ secrets.KEYSTORE_ENCRYPT_KEY }}'
keystore_password: '${{ secrets.KEYSTORE_PASSWORD }}'
key_alias: '${{ secrets.KEY_ALIAS }}'
key_password: '${{ secrets.KEY_PASSWORD }}'

steps:
- uses: actions/checkout@v3

- name: Download sapmachine JDK 11
run: |
download_url="https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.14.1/sapmachine-jdk-11.0.14.1_linux-x64_bin.tar.gz"
wget -O "${RUNNER_TEMP}/sapmachine-jdk-11.tar.gz" "${download_url}"

- name: Setup sapmachine JDK 11
uses: actions/setup-java@v2
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/sapmachine-jdk-11.tar.gz
java-version: '11.0.14'
architecture: x64
cache: 'gradle'

- uses: maxim-lobanov/setup-android-tools@v1
with:
cache: true

- name: Download Keystore
run: |
curl --header "Authorization: token ${keystore_download_token}" --header "Accept: application/vnd.github.v3.raw" --remote-name --location "${keystore_download_url}${keystore_download_filename}"
- name: Download Environment Properties
run: |
curl --header "Authorization: token ${keystore_download_token}" --header "Accept: application/vnd.github.v3.raw" --remote-name --location "${environments_download_url}${env_prop_download_filename}"
- name: Decrypt Keystore
run: openssl enc -aes-256-cbc -d -pbkdf2 -iter 100000 -in $keystore_download_filename -out $keystore_filename -k $keystore_encrypt_key

- name: Prepare commit hash
run: |
echo $GITHUB_SHA
echo "" >> "./gradle.properties"
echo "commit_hash=${GITHUB_SHA}" >> "./gradle.properties"

- name: Prepare keystore properties for Signing
run: |
echo "" >> "./keystore.properties"
echo "deviceForTestersRelease.storePath=../${keystore_filename}" >> "./keystore.properties"
echo "deviceForTestersRelease.storePassword=${keystore_password}" >> "./keystore.properties"
echo "deviceForTestersRelease.keyAlias=${key_alias}" >> "./keystore.properties"
echo "deviceForTestersRelease.keyPassword=${key_password}" >> "./keystore.properties"

- name: Quick Build
run: ./gradlew -PdisablePreDex :Corona-Warn-App:assembleDeviceForTestersRelease

- name: Archive apk
uses: actions/upload-artifact@v3
with:
path: Corona-Warn-App/build/outputs/apk/deviceForTesters/release/*.apk

- name: Send to T-System
env:
tsystems_upload_url: '${{ secrets.TSYSTEM_UPLOAD_URL }}'
tsystems_upload_bearer: '${{ secrets.TSYSTEM_UPLOAD_BEARER }}'
run: |
fileName=$(find Corona-Warn-App/build/outputs/apk/deviceForTesters/release -name '*Corona-Warn-App*.apk')
curl --location --request POST $tsystems_upload_url \
--header "Authorization: Bearer $tsystems_upload_bearer" \
--form "file=@${fileName}" \
--form "camera=true"

- name: trigger App Automation Testing
env:
CIRCLE_API_ADMIN_TOKEN: '${{ secrets.CIRCLE_API_ADMIN_TOKEN }}'
run: |
curl -u ${CIRCLE_API_ADMIN_TOKEN}: \
-d '{"branch":"main","parameters":{"mobile-os":"android"}}' \
-H 'content-type: application/json' \
https://circleci.com/api/v2/project/github/corona-warn-app/cwa-app-automation/pipeline

firebase_screenshots:
runs-on: ubuntu-latest
needs: dependencies
env:
GCLOUD_SERVICE_KEY_BASE64: '${{ secrets.GCLOUD_SERVICE_KEY_BASE64 }}'
GOOGLE_PROJECT_ID: '${{ secrets.GOOGLE_PROJECT_ID }}'
permissions:
checks: write
pull-requests: write
steps:

- uses: actions/checkout@v3

- name: Download sapmachine JDK 11
run: |
download_url="https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.14.1/sapmachine-jdk-11.0.14.1_linux-x64_bin.tar.gz"
wget -O "${RUNNER_TEMP}/sapmachine-jdk-11.tar.gz" "${download_url}"
- name: Setup sapmachine JDK 11
uses: actions/setup-java@v2
with:
distribution: 'jdkfile'
jdkFile: ${{ runner.temp }}/sapmachine-jdk-11.tar.gz
java-version: '11.0.14'
architecture: x64
cache: 'gradle'

- uses: maxim-lobanov/setup-android-tools@v1
with:
cache: true

- name: Build APKs for screenshots
run: ./gradlew -PdisablePreDex :Corona-Warn-App:assembleDebug :Corona-Warn-App:assembleAndroidTest

- name: Setup Google Cloud access
run: |
echo $GCLOUD_SERVICE_KEY_BASE64 | base64 -di > ${HOME}/gcloud-service-key.json
sudo gcloud auth activate-service-account --key-file=${HOME}/gcloud-service-key.json
sudo gcloud --quiet config set project ${GOOGLE_PROJECT_ID}

- name: Setup Testlab environment
run: |
echo "BUCKETDIR=`date "+%Y-%m-%d-%H:%M:%S:%3N"`-${RANDOM}" >> $GITHUB_ENV
- name: Test with Firebase Test Lab
run: |
echo "Using bucketdir ${{ env.BUCKETDIR }}"
sudo gcloud firebase test android run \
--type instrumentation \
--app Corona-Warn-App/build/outputs/apk/deviceForTesters/debug/*.apk \
--test Corona-Warn-App/build/outputs/apk/androidTest/deviceForTesters/debug/*.apk \
--results-dir ${BUCKETDIR} \
--results-bucket ${GOOGLE_PROJECT_ID}-circleci-android \
--environment-variables clearPackageData=true \
--test-targets "annotation testhelpers.Screenshot" \
--timeout 20m \
--device-ids blueline \
--os-version-ids 28 \
--locales de_DE,en_US \
--orientations portrait \
--no-record-video

- name: Create directory to store test results
if: always()
run: mkdir mkdir firebase-screenshots

- name: Install gsutil dependency and copy test results data
if: always()
run: |
sudo pip install -U crcmod
sudo gsutil -m cp -R -U gs://${GOOGLE_PROJECT_ID}-circleci-android/${{ env.BUCKETDIR }}/blueline* mkdir firebase-screenshots

- name: Publish Firebase Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
check_name: "Firebase Test Results"
files: "firebase-screenshots/**/*.xml"

- name: Clean up pulled bucket
run: |
sudo rm -rf firebase-screenshots/*/test_cases
sudo rm -f firebase-screenshots/*/instrumentation.results
sudo rm -f firebase-screenshots/*/logcat
sudo rm -f firebase-screenshots/*/test_result_1.xml

- name: Archive Test Result
uses: actions/upload-artifact@v3
with:
name: screenshots
path: firebase-screenshots
Loading