-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad613a2
commit 4a0dd70
Showing
3 changed files
with
126 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,99 +8,9 @@ on: | |
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
maestro-cloud: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
app: android/app/build/outputs/apk/debug | ||
steps: | ||
- name: Enable Corepack | ||
run: corepack enable | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
- name: Setup java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
- uses: pass-culture-github-actions/[email protected] | ||
id: yarn-modules-cache | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/yarn | ||
key: v1-yarn-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
v1-yarn-dependency-cache-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | ||
bucket: ${{ inputs.CACHE_BUCKET_NAME }} | ||
workload-identity-provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service-account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} | ||
- name: Yarn install | ||
run: yarn install | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Authentification to Google | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} | ||
- name: Get Secret | ||
id: 'secrets' | ||
uses: 'google-github-actions/get-secretmanager-secrets@v2' | ||
with: | ||
secrets: |- | ||
ANDROID_GOOGLE_SERVICES_JSON:passculture-metier-ehp/pc-native-android-google-service-staging | ||
ANDROID_KEYSTORE_STORE_PASSWORD:passculture-metier-ehp/passculture-app-native-android-staging-keystore-store-password | ||
ANDROID_KEYSTORE_KEY_PASSWORD:passculture-metier-ehp/passculture-app-native-android-staging-keystore-key-password | ||
ANDROID_KEYSTORE:passculture-metier-ehp/passculture-app-native-staging-keystore | ||
ROBIN_API_KEY:passculture-metier-ehp/passculture-app-native-e2e-robin-api-key | ||
MAESTRO_PASSWORD:passculture-metier-ehp/passculture-app-native-e2e-maestro-password | ||
- name: Create a directory for keystores | ||
run: | | ||
mkdir --parents android/keystores/ | ||
- name: Setup android keystore for staging environment | ||
run: | | ||
echo '${{ steps.secrets.outputs.ANDROID_KEYSTORE }}' | base64 --decode > android/keystores/staging.keystore | ||
- name: Setup android keystore properties for staging environment | ||
uses: chuhlomin/[email protected] | ||
with: | ||
template: templates_github_ci/staging.keystore.properties | ||
vars: | | ||
ENVIRONMENT: staging | ||
ANDROID_KEYSTORE_STORE_PASSWORD: ${{ steps.secrets.outputs.ANDROID_KEYSTORE_STORE_PASSWORD }} | ||
ANDROID_KEYSTORE_KEY_PASSWORD: ${{ steps.secrets.outputs.ANDROID_KEYSTORE_KEY_PASSWORD }} | ||
result_path: android/keystores/staging.keystore.properties | ||
- name: Setup android Google services config | ||
run: echo '${{ steps.secrets.outputs.ANDROID_GOOGLE_SERVICES_JSON }}' > android/app/google-services.json | ||
- name: Build android apk | ||
run: cd android && ENVFILE=.env.staging ./gradlew assembleDebug | ||
|
||
- name: Upload APK to Maestro Cloud | ||
uses: mobile-dev-inc/[email protected] | ||
with: | ||
api-key: ${{ steps.secrets.outputs.ROBIN_API_KEY }} | ||
project-id: proj_01javz1ncreqb9dcshv3y4da44 | ||
app-file: android/app/build/outputs/apk/staging/debug/app-staging-debug.apk | ||
device-locale: fr_FR | ||
android-api-level: 34 | ||
workspace: .maestro/tests/ | ||
include-tags: cloud | ||
env: | | ||
MAESTRO_APP_ID=app.passculture.staging | ||
MAESTRO_PASSWORD=${{ steps.secrets.outputs.MAESTRO_PASSWORD }} | ||
[email protected] | ||
[email protected] | ||
MAESTRO_UNREGISTERED_EMAIL=dev-tests-unregistered+e2e@passculture.team | ||
MAESTRO_MOCK_ANALYTICS_SERVER=http://localhost:$MOCK_ANALYTICS_SERVER_PORT | ||
MAESTRO_NUMBER_PHONE=0607080910 | ||
MAESTRO_RUN_TRACKING_TESTS=false | ||
MAESTRO_RUN_CLOUD_COMMANDS=true | ||
e2e-tests: | ||
uses: ./.github/workflows/reusable_e2e_android.yml | ||
secrets: | ||
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} | ||
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: '[Daily] Run E2E tests on Android' | ||
|
||
on: | ||
schedule: | ||
# 00:00 Paris UTC | ||
- cron: '* 22 * * *' | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
e2e-tests: | ||
uses: ./.github/workflows/reusable_e2e_android.yml | ||
secrets: | ||
GCP_EHP_SERVICE_ACCOUNT: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} | ||
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: 'Reusable E2E Android Workflow' | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GCP_EHP_SERVICE_ACCOUNT: | ||
required: true | ||
GCP_EHP_WORKLOAD_IDENTITY_PROVIDER: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
maestro-cloud: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Enable Corepack | ||
run: corepack enable | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- name: Yarn install | ||
run: yarn install | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Authentification to Google | ||
uses: 'google-github-actions/auth@v2' | ||
with: | ||
workload_identity_provider: ${{ secrets.GCP_EHP_WORKLOAD_IDENTITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_EHP_SERVICE_ACCOUNT }} | ||
|
||
- name: Get Secret | ||
id: 'secrets' | ||
uses: 'google-github-actions/get-secretmanager-secrets@v2' | ||
with: | ||
secrets: |- | ||
ANDROID_GOOGLE_SERVICES_JSON:passculture-metier-ehp/pc-native-android-google-service-staging | ||
ANDROID_KEYSTORE_STORE_PASSWORD:passculture-metier-ehp/passculture-app-native-android-staging-keystore-store-password | ||
ANDROID_KEYSTORE_KEY_PASSWORD:passculture-metier-ehp/passculture-app-native-android-staging-keystore-key-password | ||
ANDROID_KEYSTORE:passculture-metier-ehp/passculture-app-native-staging-keystore | ||
ROBIN_API_KEY:passculture-metier-ehp/passculture-app-native-e2e-robin-api-key | ||
MAESTRO_PASSWORD:passculture-metier-ehp/passculture-app-native-e2e-maestro-password | ||
- name: Create a directory for keystores | ||
run: mkdir --parents android/keystores/ | ||
|
||
- name: Setup android keystore for staging environment | ||
run: | | ||
echo '${{ steps.secrets.outputs.ANDROID_KEYSTORE }}' | base64 --decode > android/keystores/staging.keystore | ||
- name: Setup android keystore properties for staging environment | ||
uses: chuhlomin/[email protected] | ||
with: | ||
template: templates_github_ci/staging.keystore.properties | ||
vars: | | ||
ENVIRONMENT: staging | ||
ANDROID_KEYSTORE_STORE_PASSWORD: ${{ steps.secrets.outputs.ANDROID_KEYSTORE_STORE_PASSWORD }} | ||
ANDROID_KEYSTORE_KEY_PASSWORD: ${{ steps.secrets.outputs.ANDROID_KEYSTORE_KEY_PASSWORD }} | ||
result_path: android/keystores/staging.keystore.properties | ||
|
||
- name: Setup android Google services config | ||
run: echo '${{ steps.secrets.outputs.ANDROID_GOOGLE_SERVICES_JSON }}' > android/app/google-services.json | ||
|
||
- name: Build android apk | ||
run: cd android && ENVFILE=.env.staging ./gradlew assembleDebug | ||
|
||
- name: Run Maestro Tests | ||
uses: mobile-dev-inc/[email protected] | ||
with: | ||
api-key: ${{ steps.secrets.outputs.ROBIN_API_KEY }} | ||
project-id: proj_01javz1ncreqb9dcshv3y4da44 | ||
app-file: android/app/build/outputs/apk/staging/debug/app-staging-debug.apk | ||
device-locale: fr_FR | ||
android-api-level: 34 | ||
workspace: .maestro/tests/ | ||
include-tags: cloud | ||
env: | | ||
MAESTRO_APP_ID=app.passculture.staging | ||
MAESTRO_PASSWORD=${{ steps.secrets.outputs.MAESTRO_PASSWORD }} | ||
[email protected] | ||
[email protected] | ||
MAESTRO_UNREGISTERED_EMAIL=dev-tests-unregistered+e2e@passculture.team | ||
MAESTRO_MOCK_ANALYTICS_SERVER=http://localhost:$MOCK_ANALYTICS_SERVER_PORT | ||
MAESTRO_NUMBER_PHONE=0607080910 | ||
MAESTRO_RUN_TRACKING_TESTS=false | ||
MAESTRO_RUN_CLOUD_COMMANDS=true |