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

Ditches integration with Maestro Cloud #1544

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
382 changes: 179 additions & 203 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,209 +1,185 @@
name: CI

on:
pull_request:
push:
branches:
- master
pull_request:
push:
branches:
- master

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

jobs:
code-quality:
runs-on: ubuntu-24.04
timeout-minutes: 10

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
shell: bash
run: ./scripts/setup-asdf.sh

- name: Check Kotlin sources
run: ./scripts/code-style-kotlin.sh all

- name: Check Bash sources
run: ./scripts/code-style-bash.sh

- name: Check typos on code
uses: crate-ci/[email protected]

unit-tests:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: [code-quality]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Run unit tests
uses: nick-fields/[email protected]
with:
command: ./gradlew clean test --no-daemon
timeout_minutes: 8
max_attempts: 5

- name: Collect all test results from all modules
if: always()
run: ./scripts/aggregate-test-reports.sh build/test-reports

- name: Archive test results
if: always()
uses: actions/[email protected]
with:
name: unit-tests-reports
path: build/test-reports

assemble-apk:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [code-quality]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Assemble APKs
run: ./gradlew app:assembleRelease -PtestMode=true --no-daemon

- name: Archive Release APK
if: success()
uses: actions/[email protected]
with:
name: release-apk
path: app/build/outputs/apk/release

- name: Archive R8 mappings
if: success()
uses: actions/[email protected]
with:
name: release-mappings
path: app/build/outputs/mapping/release

functional-tests:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [assemble-apk]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
shell: bash
run: ./scripts/setup-asdf.sh

- name: Fetch Instrumentation artefacts
uses: actions/[email protected]

- name: Run E2E tests on mobile.dev clould
run: ./scripts/maestro.sh release-apk/app-release.apk
env:
MOBILE_DEV_CLOUD_TOKEN: ${{ secrets.MOBILE_DEV_CLOUD_TOKEN }}

instrumentation-tests:
runs-on: ubuntu-24.04
needs: [code-quality]
timeout-minutes: 20
strategy:
matrix:
feature: [ 'facts', 'search' ]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Fetch Instrumentation artefacts
uses: actions/[email protected]

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Run instrumentation tests
run: ./gradlew features:${{ matrix.feature }}:testDebugWithEmulatorWtf
env:
EW_API_TOKEN: ${{ secrets.EMULATOR_WTF_TOKEN }}

- name: Archive test results
if: always()
uses: actions/[email protected]
with:
name: ${{ matrix.feature }}-instrumentation-tests-reports
path: features/${{ matrix.feature }}/build/test-results

security-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: assemble-apk

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh

- name: Validate Gradle Wrapper
uses: gradle/[email protected]

- name: Fetch APK from previous build
uses: actions/[email protected]

- name: Compare APK with baseline
run: aaw compare -a release-apk/app-release.apk -b .config/norris-watchdog.toml

- name: Scan APK for vulnerabilities with Appsweep
uses: dotanuki-labs/[email protected]
with:
archive-file: release-apk/app-release.apk
symbols: release-mappings/mapping.txt
wait-for-summary: true
env:
APPSWEEP_API_KEY: ${{ secrets.APP_SWEEP_TOKEN }}

test-results-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [unit-tests, instrumentation-tests, functional-tests]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Fetch all artefacts
uses: actions/[email protected]

- name: Copy all test results
run: mkdir all-reports && mv *-tests-reports/ all-reports

- name: Report test results
uses: dorny/[email protected]
with:
name: 'Test Reports'
reporter: java-junit
path: all-reports/**/*.xml
code-quality:
runs-on: ubuntu-24.04
timeout-minutes: 10

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
shell: bash
run: ./scripts/setup-asdf.sh

- name: Check Kotlin sources
run: ./scripts/code-style-kotlin.sh all

- name: Check Bash sources
run: ./scripts/code-style-bash.sh

- name: Check typos on code
uses: crate-ci/[email protected]

unit-tests:
runs-on: ubuntu-24.04
timeout-minutes: 10
needs: [code-quality]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Run unit tests
uses: nick-fields/[email protected]
with:
command: ./gradlew clean test --no-daemon
timeout_minutes: 8
max_attempts: 5

- name: Collect all test results from all modules
if: always()
run: ./scripts/aggregate-test-reports.sh build/test-reports

- name: Archive test results
if: always()
uses: actions/[email protected]
with:
name: unit-tests-reports
path: build/test-reports

assemble-apk:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [code-quality]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Assemble APKs
run: ./gradlew app:assembleRelease -PtestMode=true --no-daemon

- name: Archive Release APK
if: success()
uses: actions/[email protected]
with:
name: release-apk
path: app/build/outputs/apk/release

- name: Archive R8 mappings
if: success()
uses: actions/[email protected]
with:
name: release-mappings
path: app/build/outputs/mapping/release

instrumentation-tests:
runs-on: ubuntu-24.04
needs: [code-quality]
timeout-minutes: 20
strategy:
matrix:
feature: ["facts", "search"]

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Fetch Instrumentation artefacts
uses: actions/[email protected]

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh

- name: Setup Android Build
uses: ./.github/actions/setup-android-build

- name: Run instrumentation tests
run: ./gradlew features:${{ matrix.feature }}:testDebugWithEmulatorWtf
env:
EW_API_TOKEN: ${{ secrets.EMULATOR_WTF_TOKEN }}

- name: Archive test results
if: always()
uses: actions/[email protected]
with:
name: ${{ matrix.feature }}-instrumentation-tests-reports
path: features/${{ matrix.feature }}/build/test-results

security-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: assemble-apk

steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install local CLI tooling
run: ./scripts/setup-asdf.sh

- name: Validate Gradle Wrapper
uses: gradle/[email protected]

- name: Fetch APK from previous build
uses: actions/[email protected]

- name: Compare APK with baseline
run: aaw compare -a release-apk/app-release.apk -b .config/norris-watchdog.toml

- name: Scan APK for vulnerabilities with Appsweep
uses: dotanuki-labs/[email protected]
with:
archive-file: release-apk/app-release.apk
symbols: release-mappings/mapping.txt
wait-for-summary: true
env:
APPSWEEP_API_KEY: ${{ secrets.APP_SWEEP_TOKEN }}

test-results-analysis:
runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [unit-tests, instrumentation-tests]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Fetch all artefacts
uses: actions/[email protected]

- name: Copy all test results
run: mkdir all-reports && mv *-tests-reports/ all-reports

- name: Report test results
uses: dorny/[email protected]
with:
name: "Test Reports"
reporter: java-junit
path: all-reports/**/*.xml
Loading
Loading