Skip to content
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
2 changes: 1 addition & 1 deletion .github/actions/build-and-e2e-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ runs:
- name: Run build and prebuild step for workspace
run: |
npx turbo run build --filter=./typescript/apps/${{ inputs.workspace }}
yarn workspace @dbbs/${{ inputs.workspace }} prebuild
yarn workspace @dbbs/${{ inputs.workspace }} prebuild:dev
shell: bash

- name: Start metro server
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/setup-flutter/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Setup flutter'
description: 'Setup flutter with specified version from dart/.tool-versions'

inputs:
ref:
description: Ref for checkout. Use the github.ref
required: true

runs:
using: "composite"
steps:
- name: Extract flutter version from dart/.tool-versions
id: flutter_version
run: |
FLUTTER_VERSION="$(grep -v '#' dart/.tool-versions | grep flutter | awk '{print $2}')"
echo "FLUTTER_VERSION=$FLUTTER_VERSION" >> $GITHUB_ENV
shell: bash

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.flutter_version.outputs.FLUTTER_VERSION }}
channel: 'stable'
cache: true
3 changes: 2 additions & 1 deletion .github/workflows/auto-run-e2e-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

# Disabled until self-hosted mac runner issues are resolved
# on:
# schedule:
# - cron: '0 0 * * *'

jobs:
test-dev:
if: ${{ github.ref || 'refs/heads/main' }}
runs-on: self-hosted
runs-on: ubuntu-24.04
timeout-minutes: 60
environment: ${{ format('{0}_{1}', 'mobile-app', 'development') }}
steps:
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/test_dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Test Dart

run-name: Test Dart ${{ github.head_ref || github.ref }}

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
paths:
- dart/**
- .github/workflows/test_dart.yml
- .github/actions/setup-flutter.yml
- .github/actions/setup-yarn.yml
- .github/actions/setup-node.yml
push:
branches:
- main

jobs:
test-and-build:
runs-on: [ubuntu-24.04]
environment: development
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Fetch main branch
if: github.ref != 'refs/heads/main'
run: |
git fetch origin main:main

- name: Cache turbo setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-

- name: Use Setup Yarn action
uses: ./.github/actions/setup-yarn

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.tool-versions'
cache: 'yarn'

- name: Setup Flutter
uses: ./.github/actions/setup-flutter

- name: Build dependencies
run: |
yarn install --immutable

- name: List and extract affected projects
run: |
npx turbo ls --affected --output=json > affected.json

export AFFECTED_PATHS=$(jq -r '.packages.items
| map(select(.path | startswith("dart/")) | .path = "./" + .path)
| map(.path)
| join(" ")' affected.json)

if [ -z "$AFFECTED_PATHS" ] && [ "$GITHUB_EVENT_NAME" != "pull_request" ]; then
AFFECTED_PATHS="./dart/**/*"
fi

FILTER_ARGS=$(for path in $AFFECTED_PATHS; do echo "--filter=$path"; done | xargs)

echo "FILTER_ARGS=$FILTER_ARGS" >> $GITHUB_ENV
echo "AFFECTED_PATHS=$AFFECTED_PATHS" >> $GITHUB_ENV

echo $GITHUB_EVENT_NAME
echo $AFFECTED_PATHS
shell: bash

- name: Install Flutter deps
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo run install:deps ${{ env.FILTER_ARGS }}

- name: Create secret files
run: |
echo -n "${{ secrets.FLUTTER_ENV_DEVELOPMENT }}" | base64 --decode > ./dart/apps/flutter_mobile/.env.development
echo -n "${{ secrets.FLUTTER_ENV_PRODUCTION }}" | base64 --decode > ./dart/apps/flutter_mobile/.env.production
echo -n "${{ secrets.FLUTTER_FIREBASE_CREDENTIALS }}" | base64 --decode > ./dart/apps/flutter_mobile/firebase.json
echo -n "${{ secrets.FLUTTER_GOOGLE_SERVICE_ACCOUNT_ANDROID }}" | base64 --decode > ./dart/apps/flutter_mobile/android/app/google-service-account.json
echo -n "${{ secrets.FLUTTER_GOOGLE_SERVICE_ACCOUNT_IOS }}" | base64 --decode > ./dart/apps/flutter_mobile/ios/Runner/google-service-account.json
shell: bash

- name: Typecheck
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo check-types ${{ env.FILTER_ARGS }}

- name: Test
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo run test ${{ env.FILTER_ARGS }}

- name: Alert on main fail
uses: slackapi/slack-github-action@v2.0.0
if: failure() && github.ref == 'refs/heads/main'
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
payload: |
channel: ${{ vars.SLACK_ALERTS_CHANNEL_ID }}
text: ":this-is-fine-fire: *GitHub Action Job auto-run-test-jobs.yml Failed*\n
*Job*: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n
*Author*: https://github.com/${{ github.actor }}"
13 changes: 10 additions & 3 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:

jobs:
test-and-build:
runs-on: ubuntu-24.04
runs-on: [ubuntu-24.04]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Install Python deps
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo run install:deps
npx turbo run install:deps ${{ env.FILTER_ARGS }}

- name: Typecheck
if: ${{ env.AFFECTED_PATHS != '' }}
Expand All @@ -100,6 +100,13 @@ jobs:
run: |
npx turbo run test ${{ env.FILTER_ARGS }}

- name: Sonarcloud Scan
uses: sonarsource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONARCLOUD_URL: "https://sonarcloud.io"
# RUNNER_DEBUG: "1" # Enable runner debug logging for more verbose output (useful for troubleshooting, remove for normal runs)

- name: Alert on main fail
uses: slackapi/slack-github-action@v2.0.0
if: failure() && github.ref == 'refs/heads/main'
Expand All @@ -110,4 +117,4 @@ jobs:
channel: ${{ vars.SLACK_ALERTS_CHANNEL_ID }}
text: ":this-is-fine-fire: *GitHub Action Job auto-run-test-jobs.yml Failed*\n
*Job*: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n
*Author*: https://github.com/${{ github.actor }}"
*Author*: https://github.com/${{ github.actor }}"
12 changes: 9 additions & 3 deletions .github/workflows/test_typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ on:

jobs:
test-and-build:
runs-on: ubuntu-24.04
runs-on: [ubuntu-24.04]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -89,7 +89,6 @@ jobs:
echo $GITHUB_EVENT_NAME
echo $AFFECTED_PATHS
shell: bash


- name: Configure AWS Credentials
run: |
Expand All @@ -110,12 +109,19 @@ jobs:
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo check-types ${{ env.FILTER_ARGS }}

- name: Test
if: ${{ env.AFFECTED_PATHS != '' }}
run: |
npx turbo run test ${{ env.FILTER_ARGS }}

- name: Sonarcloud Scan
uses: sonarsource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONARCLOUD_URL: "https://sonarcloud.io"
# RUNNER_DEBUG: "1" # Enable runner debug logging for more verbose output (useful for troubleshooting, remove for normal runs)

- name: Alert on main fail
uses: slackapi/slack-github-action@v2.0.0
if: failure() && github.ref == 'refs/heads/main'
Expand Down
Loading
Loading