Skip to content

Commit

Permalink
Merge pull request #648 from hpi-studyu/dev
Browse files Browse the repository at this point in the history
Release July 24
  • Loading branch information
johannesvedder committed Jul 25, 2024
2 parents 492807a + 30835ba commit 45d0dba
Show file tree
Hide file tree
Showing 672 changed files with 20,032 additions and 88,454 deletions.
3 changes: 3 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.22.3"
}
17 changes: 0 additions & 17 deletions .github/docker/db-docs.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@
'documentation':
- 'docs/**/*'
- '**/*.md'
'docker':
- 'docker/**/*'
69 changes: 0 additions & 69 deletions .github/scripts/generate-uml.bash

This file was deleted.

38 changes: 26 additions & 12 deletions .github/workflows/all_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- "core/**"
- "designer_v2/**"
- "flutter_common/**"
- '*.gitignore'
- 'melos.yaml'
- 'pubspec.yaml'
- 'pubspec.lock'
- ".github/workflows/all_packages.yml"
- ".github/workflows/init-workspace/**"
workflow_dispatch:
Expand All @@ -16,29 +20,39 @@ concurrency:
cancel-in-progress: true

jobs:
analyze:
static_analysis:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.READY_TO_MERGE_TOKEN }}

- name: Init workspace
uses: ./.github/workflows/init-workspace

- name: Run generate
run: melos run generate

# - name: Run fix # remove until flutter_gen issue is fixed
# run: melos run fix

- name: Run bootstrap
run: melos bootstrap

- name: Run format
run: melos format

- name: Run analyze
run: melos run analyze
run: melos analyze

format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v5
with:
fetch-depth: 0
- name: Init workspace
uses: ./.github/workflows/init-workspace
- name: Run format
run: melos run format:ci
commit_message: 'chore: Apply static analysis changes'

test:
runs-on: ubuntu-latest
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/check-uncomitted-changes.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/db-docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/deploy-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

app-store-release:
name: Create App Store Release
runs-on: macos-14 # macos-latest
runs-on: macos-latest
steps:
- name: Await potential publishing on Pub.dev
uses: johannesvedder/await-workflow@v1
Expand Down
43 changes: 29 additions & 14 deletions .github/workflows/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ name: E2E tests
on:
push:
paths:
- ".github/workflows/e2e_tests.yml"
- ".github/workflows/init-workspace/action.yml"
- 'designer_v2/**'
- 'core/**'
- 'flutter_common/**'
workflow_dispatch:

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

jobs:
drive_web:
runs-on: ubuntu-latest
Expand All @@ -20,35 +18,52 @@ jobs:
uses: johannesvedder/await-workflow@v1
with:
workflowId: 'publish_pubdev.yml'

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Init workspace
uses: ./.github/workflows/init-workspace

- name: Setup ChromeDriver
uses: nanasess/setup-chromedriver@v2

- name: Enable web support
run: flutter config --enable-web
- name: Initialize Supabase

- name: Prepare environment
run: |
dart pub get
dart pub global activate melos
melos bootstrap
dart pub get
docker network create studyu_network || true
cp docker/supabase/.env.example docker/supabase/.env
cp docker/proxy/.env.example docker/proxy/.env
- name: Prepare Supabase CI Seed
run: |
cp supabase/seed-ci.sql supabase/seed.sql
- name: Set up Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest

- name: Start Supabase
run: |
supabase start -x studio,imgproxy
- name: Configure local StudyU environment
run: |
cp flutter_common/lib/envs/.env.local.example flutter_common/lib/envs/.env.local
docker compose -f docker/supabase/docker-compose-db.yml up -d
docker compose -f docker/supabase/docker-compose.yml up -d
docker compose -f docker/proxy/docker-compose-proxy.yml up -d
while [ "$(docker inspect --format='{{.State.Health.Status}}' supabase-db)" != "healthy" ]; do sleep 1; done
docker exec -i supabase-db psql -U postgres -d postgres < ./database/app_config.sql.example
LC_ALL=C sed -i.bak '/STUDYU_SUPABASE_PUBLIC_ANON_KEY/d' flutter_common/lib/envs/.env.local
echo "STUDYU_SUPABASE_PUBLIC_ANON_KEY=$(supabase status -o env | grep ANON_KEY | cut -d'=' -f2)" >> flutter_common/lib/envs/.env.local
- name: Start Chrome Driver
run: |
export DISPLAY=:99
chromedriver --port=4444 &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Run Flutter E2E tests
working-directory: ./designer_v2
run: |
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/init-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@ description: Initialize workspace for all packages
runs:
using: "composite"
steps:
- name: Set up Flutter
uses: subosito/flutter-action@v2
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action

- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
id: flutter-action

- run: |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
mkdir -p .fvm
ln -s ${{ steps.flutter-action.outputs.CACHE-PATH }} .fvm/flutter_sdk
shell: bash
- name: Install melos
run: dart pub global activate melos
shell: bash

- name: Bootstrap workspace
run: melos bootstrap
shell: bash

- name: Dart pub root project
run: dart pub get
shell: bash
30 changes: 30 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linter

on:
push:

jobs:
linter:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.READY_TO_MERGE_TOKEN }}

- name: Check final newline
uses: johannesvedder/check-final-newline@main
with:
fail_on_missing_newline: 'false'

- name: Restore ignored files
run: |
git checkout -- **/l10n-missing.txt
- name: Commit changes if any
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'lint: Apply final newline changes'
Loading

0 comments on commit 45d0dba

Please sign in to comment.