Skip to content

Commit

Permalink
add step to launch release tests
Browse files Browse the repository at this point in the history
  • Loading branch information
malmstein committed Oct 16, 2024
1 parent 5bbbc1d commit 839f90b
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 35 deletions.
92 changes: 58 additions & 34 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,84 @@
name: Docs
name: Run Release Tests in Maestro

on:
push:
branches: ["develop"]

workflow_dispatch:
inputs:
app-version:
description: 'App Version for Release'
required: true
default: 'PLACEHOLDER'

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
run-release-tests:
name: Run Release tests of tag version in Maestro
runs-on: ubuntu-20.04

steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.event.inputs.app-version }}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

- name: Create folder
if: always()
run: mkdir apk

- name: Decode keys
uses: davidSchuppa/base64Secret-toFile-action@v2
with:
secret: ${{ secrets.FAKE_RELEASE_PROPERTIES }}
fileName: ddg_android_build.properties
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/

- name: Decode key file
uses: davidSchuppa/base64Secret-toFile-action@v2
with:
secret: ${{ secrets.FAKE_RELEASE_KEY }}
fileName: android
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: ./gradlew dokkaHtmlMultiModule
- name: Assemble release APK
run: ./gradlew assemblePlayRelease -Pforce-default-variant

- name: Copy files
run: |
mkdir -p docs
mv build/dokka/htmlMultiModule/* docs
- name: Move APK to new folder
if: always()
run: find . -name "*.apk" -exec mv '{}' apk/release.apk \;

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Release tests flows
uses: mobile-dev-inc/[email protected]
with:
api-key: ${{ secrets.MOBILE_DEV_API_KEY }}
name: ${{ github.sha }}
app-file: apk/release.apk
android-api-level: 30
workspace: .maestro
include-tags: releaseTest

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
- name: Create Asana task when workflow failed
if: ${{ failure() }}
id: create-failure-task
uses: duckduckgo/[email protected]
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
asana-pat: ${{ secrets.GH_ASANA_SECRET }}
asana-project: ${{ vars.GH_ANDROID_APP_PROJECT_ID }}
asana-section: ${{ vars.GH_ANDROID_APP_INCOMING_SECTION_ID }}
asana-task-name: GH Workflow Failure - Tag Android Release
asana-task-description: Tag Android Release has failed. See https://github.com/duckduckgo/Android/actions/runs/${{ github.run_id }}
action: 'create-asana-task'
60 changes: 60 additions & 0 deletions .github/workflows/docs_copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Docs

on:
push:
branches: ["develop"]

workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Execute Gradle build
run: ./gradlew dokkaHtmlMultiModule

- name: Copy files
run: |
mkdir -p docs
mv build/dokka/htmlMultiModule/* docs
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
app-version: ${{ github.event.inputs.app-version }}

report_error:
- name: Create Asana task when workflow failed
name: Create Asana task when workflow failed
if: ${{ failure() }}
id: create-failure-task
uses: duckduckgo/[email protected]
Expand Down

0 comments on commit 839f90b

Please sign in to comment.