Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/13058 GitHub actions #1

Draft
wants to merge 66 commits into
base: release/2.23.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
005d56d
Create check.yml
kaddaSz May 12, 2022
e75bcb2
Update check.yml
kaddaSz May 12, 2022
fa34baf
Delete check.yml
kaddaSz May 12, 2022
e9229e0
Create check.yml
kaddaSz May 12, 2022
c2ed14b
Update check.yml
kaddaSz May 12, 2022
f833ccc
Update check.yml
kaddaSz May 12, 2022
7de5b4d
Update check.yml
kaddaSz May 12, 2022
a17343a
Update check.yml
kaddaSz May 12, 2022
ad9e5e2
Update check.yml
kaddaSz May 12, 2022
bf34332
Update check.yml
kaddaSz May 12, 2022
bcc9d97
Update check.yml
kaddaSz May 12, 2022
fb691a0
Update check.yml
kaddaSz May 12, 2022
d943f27
Update check.yml
kaddaSz May 13, 2022
64f3505
Update check.yml
kaddaSz May 13, 2022
e9f97a5
Update check.yml
kaddaSz May 13, 2022
0f8d175
Update check.yml
kaddaSz May 13, 2022
388ff0f
Update check.yml
kaddaSz May 13, 2022
08bcd3a
Update check.yml
kaddaSz May 13, 2022
9b80b03
Update check.yml
kaddaSz May 13, 2022
e17d487
Update check.yml
kaddaSz May 13, 2022
22d3a02
Update check.yml
kaddaSz May 13, 2022
a7bbfc1
Update check.yml
kaddaSz May 13, 2022
b774d12
Update check.yml
kaddaSz May 13, 2022
7725805
Update check.yml
kaddaSz May 13, 2022
12e6e95
Update check.yml
kaddaSz May 13, 2022
0147206
Update check.yml
kaddaSz May 16, 2022
422ce25
Update check.yml
kaddaSz May 16, 2022
5103b9e
Update check.yml
kaddaSz May 16, 2022
f632743
Update check.yml
kaddaSz May 16, 2022
62877d1
Update check.yml
kaddaSz May 16, 2022
02f2f70
Update check.yml
kaddaSz May 16, 2022
74f29d2
Update check.yml
kaddaSz May 16, 2022
9e1b6f2
Update check.yml
kaddaSz May 16, 2022
681e2d2
Update check.yml
kaddaSz May 16, 2022
6c8534a
Update check.yml
kaddaSz May 16, 2022
adf070d
Update check.yml
kaddaSz May 16, 2022
f98136f
Update check.yml
kaddaSz May 16, 2022
e79dba1
Update check.yml
kaddaSz May 16, 2022
f9d08e6
Update check.yml
kaddaSz May 16, 2022
caaa4d6
Update check.yml
kaddaSz May 17, 2022
7ef9920
Update check.yml
kaddaSz May 17, 2022
451c7b3
Update check.yml
kaddaSz May 17, 2022
6a3fdd9
Update check.yml
kaddaSz May 17, 2022
76c8360
Update check.yml
kaddaSz May 17, 2022
4d51193
Update check.yml
kaddaSz May 17, 2022
655a9b2
Create ReleaseCandidate.yml
kaddaSz May 17, 2022
82a3002
Update ReleaseCandidate.yml
kaddaSz May 17, 2022
7abb792
Update ReleaseCandidate.yml
kaddaSz May 17, 2022
e11aca5
Update ReleaseCandidate.yml
kaddaSz May 17, 2022
b29753a
Update ReleaseCandidate.yml
kaddaSz May 17, 2022
33cc4b8
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
00978d6
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
0597aaa
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
62abae8
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
a856b49
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
6656205
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
4e6ecac
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
209a862
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
f2f48f5
Update ReleaseCandidate.yml
kaddaSz May 18, 2022
7dfe48f
Update check.yml
kaddaSz May 19, 2022
9752acc
Update check.yml
kaddaSz May 19, 2022
426e3d8
Update check.yml
kaddaSz May 19, 2022
e413bf5
Update check.yml
kaddaSz May 19, 2022
6f78b67
Update check.yml
kaddaSz May 19, 2022
b28dca3
Update check.yml
kaddaSz May 19, 2022
23576b8
Update check.yml
kaddaSz May 20, 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
220 changes: 220 additions & 0 deletions .github/workflows/ReleaseCandidate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
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