Skip to content
Closed
Show file tree
Hide file tree
Changes from 18 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
170 changes: 0 additions & 170 deletions .circleci/config.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
runs:
using: composite
steps:
- name: Setup JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper/dists
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-

- name: Setup local variables
shell: bash
run: echo "VGS_VAULT_ID=$VGS_VAULT_ID" >> local.properties
118 changes: 118 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
name: 'CI'

on:
pull_request:
branches:
Comment thread
DmytroDm marked this conversation as resolved.
Outdated
- '**'
push:
branches:
- 'main'
Comment thread
sylwit marked this conversation as resolved.
tags:
- 'v*'

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

permissions:
contents: read
checks: write # For publishing test results

jobs:
run-unit-tests:
name: 'Run Unit Tests'
runs-on: macos-14
Comment thread
DmytroDm marked this conversation as resolved.
Outdated
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: true

- name: Setup environment
uses: ./.github/actions/setup
env:
VGS_VAULT_ID: ${{ secrets.VGS_VAULT_ID }}

- name: Run Detekt
run: ./gradlew vgsshow:detekt --continue

- name: Run Unit Tests
run: ./gradlew vgsshow:testDebugUnitTest --continue

- name: (Compass) Generate Code Coverage Report
if: github.ref == 'refs/heads/main'
run: ./gradlew vgsshow:koverHtmlReportDebug

- name: (Compass) Extract Code Coverage
id: coverage
if: github.ref == 'refs/heads/main'
run: |
COVERAGE=$(sed -n '51p' vgsshow/build/reports/kover/htmlDebug/index.html)
Comment thread
DmytroDm marked this conversation as resolved.
METRIC_VALUE=`echo ${COVERAGE//[[:space:]]/} | sed 's/.$//'`

echo "metric_value=$METRIC_VALUE" >> $GITHUB_OUTPUT

# - name: (Compass) Publish code coverage
# if: github.ref == 'refs/heads/main'
# uses: verygood-ops/cicd-shared/.github/actions/compass@compass-action-v1.0.0
# with:
# metric_source_id: 'ari:cloud:compass:83673fa7-fd28-4f4a-9738-f584064570a7:component/db43f86d-85fe-42e1-954d-457f5a4082b8/444114a1-5d6c-4c2e-96c6-5895cd094e6a'
# metric_value: ${{ steps.coverage.outputs.metric_value }}
# api_key: ${{ secrets.COMPASS_API_KEY }}

- name: Upload Test Results
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: unit-test-results
path: |
**/build/test-results/**/*.xml
**/build/reports/**
retention-days: 30

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: ${{ !cancelled() }}
with:
report_paths: '**/build/test-results/**/TEST-*.xml'
check_name: 'Unit Test Results'
fail_on_failure: true

run-ui-tests:
name: 'Run UI Tests'
runs-on: macos-14
if: ${{ startsWith(github.head_ref, 'release/') }}

steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: true

- name: Setup environment
uses: ./.github/actions/setup
env:
VGS_VAULT_ID: ${{ secrets.VGS_VAULT_ID }}

- name: Auth Google Cloud SDK
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}

- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v3

- name: Assemble debug & test APK
run: ./gradlew assembleDebug assembleAndroidTest

- name: Run UI tests
run: |
gcloud firebase test android run \
--type instrumentation \
--app app/build/outputs/apk/debug/app-debug.apk \
--test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device model=oriole,version=31,locale=en,orientation=portrait \
--device model=blazer,version=36,locale=en,orientation=portrait