2022-06-19 13:16:35 +00:00
|
|
|
name: Test
|
|
|
|
on:
|
2022-07-16 05:48:35 +00:00
|
|
|
workflow_dispatch:
|
2022-06-19 13:16:35 +00:00
|
|
|
pull_request:
|
2022-08-11 13:27:44 +00:00
|
|
|
push:
|
|
|
|
branches: [main]
|
2022-06-19 13:16:35 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-01-15 19:08:24 +00:00
|
|
|
e2e-tests:
|
|
|
|
name: Run end-to-end test suites
|
2022-06-19 13:16:35 +00:00
|
|
|
|
2023-01-15 19:08:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-19 13:16:35 +00:00
|
|
|
|
2023-01-15 19:08:24 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
2022-06-19 13:16:35 +00:00
|
|
|
|
2023-01-15 19:08:24 +00:00
|
|
|
- name: Run Immich Server E2E Test
|
|
|
|
run: docker-compose -f ./docker/docker-compose.test.yml --env-file ./docker/.env.test up --abort-on-container-exit --exit-code-from immich-server-test
|
2022-08-11 13:27:44 +00:00
|
|
|
|
2022-09-08 09:07:27 +00:00
|
|
|
server-unit-tests:
|
|
|
|
name: Run server unit test suites and checks
|
2022-08-11 13:27:44 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-08-11 18:46:11 +00:00
|
|
|
steps:
|
2022-08-11 13:27:44 +00:00
|
|
|
- name: Checkout code
|
2022-09-07 11:08:44 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-08-11 13:27:44 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
2022-09-08 09:07:27 +00:00
|
|
|
run: cd server && npm ci && npm run check:all
|
2022-09-08 15:44:13 +00:00
|
|
|
|
|
|
|
web-unit-tests:
|
|
|
|
name: Run web unit test suites and checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: cd web && npm ci && npm run check:all
|
2023-01-25 16:10:04 +00:00
|
|
|
|
|
|
|
mobile-unit-tests:
|
|
|
|
name: Run mobile unit tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-01-30 16:14:58 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-25 16:10:04 +00:00
|
|
|
- name: Setup Flutter SDK
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: 'stable'
|
2023-02-11 20:23:32 +00:00
|
|
|
flutter-version: '3.7.3'
|
2023-01-25 16:10:04 +00:00
|
|
|
- name: Run tests
|
|
|
|
working-directory: ./mobile
|
|
|
|
run: flutter test
|
|
|
|
|
|
|
|
mobile-integration-tests:
|
|
|
|
name: Run mobile end-to-end integration tests
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
2023-01-30 16:14:58 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-25 16:10:04 +00:00
|
|
|
- uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: 'adopt'
|
|
|
|
java-version: '11'
|
|
|
|
- name: Cache android SDK
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: android-sdk
|
|
|
|
with:
|
|
|
|
key: android-sdk
|
|
|
|
path: |
|
|
|
|
/usr/local/lib/android/
|
|
|
|
~/.android
|
|
|
|
- name: Setup Android SDK
|
|
|
|
if: steps.android-sdk.outputs.cache-hit != 'true'
|
|
|
|
uses: android-actions/setup-android@v2
|
|
|
|
- name: Setup Flutter SDK
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: 'stable'
|
2023-02-11 20:23:32 +00:00
|
|
|
flutter-version: '3.7.3'
|
2023-01-25 16:10:04 +00:00
|
|
|
- name: Run integration tests
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2.27.0
|
|
|
|
with:
|
|
|
|
working-directory: ./mobile
|
|
|
|
api-level: 29
|
|
|
|
arch: x86_64
|
|
|
|
profile: pixel
|
|
|
|
target: default
|
|
|
|
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
|
|
|
|
disable-linux-hw-accel: false
|
|
|
|
script: |
|
|
|
|
flutter pub get
|
|
|
|
flutter test integration_test
|