-
Notifications
You must be signed in to change notification settings - Fork 20
156 lines (133 loc) · 5.08 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
on:
pull_request:
name: Tests
env:
FLUTTER_VERSION: 3.24.0
jobs:
code_analyze:
name: Analyze code
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
checks: write
pull-requests: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}"
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Run code analysis
run: ./scripts/code_analyze.sh
widget_test:
name: Widget test
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}"
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Run widget test
run: |
flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs
flutter test
# integration_test:
# name: Integration test
# runs-on: macos-latest
# strategy:
# matrix:
# homeserver:
# - synapse
# - dendrite
# - conduit
# # flavor:
# # - google
# # - nongoogle
# fail-fast: false
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: Setup flutter
# uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ env.FLUTTER_VERSION }}
# channel: "stable"
# cache: true
# - name: Setup Java
# uses: actions/setup-java@v4
# with:
# distribution: "temurin"
# java-version: "11"
# - name: Install dependencies
# run: |
# brew install ldns grep scrcpy ffmpeg docker
# flutter pub get
# colima start
# - name: Prepare homeservers
# env:
# HOMESERVER: localhost
# run: |
# # Create test users environment variables
# source ./scripts/integration-create-environment-variables.sh
# # Create matrix homeservers containers
# ./scripts/integration-server-${{ matrix.homeserver }}.sh
# # Set homeserver IP and create test users
# ./scripts/integration-prepare-homeserver.sh
# # Set users environment variables for next step
# echo USER1_NAME="alice" >> $GITHUB_ENV
# echo USER1_PW="AliceInWonderland">> $GITHUB_ENV
# echo USER2_NAME="bob" >> $GITHUB_ENV
# echo USER2_PW="JoWirSchaffenDas" >> $GITHUB_ENV
# # - name: Run integration tests for non-Google builds
# # uses: reactivecircus/android-emulator-runner@v2
# # if: matrix.flavor == 'nongoogle'
# # env:
# # HOMESERVER: localhost
# # with:
# # api-level: 31
# # target: google_apis
# # arch: x86_64
# # script: |
# # scrcpy --no-display --record video-${{ matrix.flavor }}.mkv &
# # flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 )
# # # Convert the video record to mp4
# # ffmpeg -i video-${{ matrix.flavor }}.mkv -vf scale=iw/2:-2 -crf 40 -b:v 2000k -preset fast video-${{ matrix.flavor }}.mp4 || true
# # timeout-minutes: 30
# - name: Run integration tests for Google builds
# uses: reactivecircus/android-emulator-runner@v2
# # if: matrix.flavor == 'google'
# env:
# HOMESERVER: localhost
# with:
# api-level: 31
# target: google_apis
# arch: x86_64
# script: |
# scrcpy --no-display --record video-${{ matrix.flavor }}.mkv &
# flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 )
# # Convert the video record to mp4
# ffmpeg -i video-${{ matrix.flavor }}.mkv -vf scale=iw/2:-2 -crf 40 -b:v 2000k -preset fast video-${{ matrix.flavor }}.mp4 || true
# pre-emulator-launch-script: |
# git apply ./scripts/enable-android-google-services.patch
# timeout-minutes: 30
# - name: Upload video
# uses: actions/upload-artifact@v4
# with:
# name: integration-test-recording
# path: video-${{ matrix.flavor }}.mp4