-
Notifications
You must be signed in to change notification settings - Fork 49
64 lines (55 loc) · 1.92 KB
/
build.yml
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
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Create env file
env:
API_BASE_URL: ${{ secrets.API_BASE_URL }}
CONNECT_TIMEOUT: 100000
SEND_TIMEOUT: 1000000
RECEIVE_TIMEOUT: 1000000
RECEIVE_DATA_WHEN_STATUS_ERROR: true
run: |
echo "{" >> .env.json
echo "API_BASE_URL:$API_BASE_URL," >> .env.json
echo "CONNECT_TIMEOUT:$CONNECT_TIMEOUT," >> .env.json
echo "SEND_TIMEOUT:$SEND_TIMEOUT," >> .env.json
echo "RECEIVE_TIMEOUT:$RECEIVE_TIMEOUT," >> .env.json
echo "RECEIVE_DATA_WHEN_STATUS_ERROR:$RECEIVE_DATA_WHEN_STATUS_ERROR" >> .env.json
echo "}" >> .env.json
- name: Create Staging env file
env:
API_BASE_URL: ${{ secrets.STAGING_API_BASE_URL}}
CONNECT_TIMEOUT: 100000
SEND_TIMEOUT: 1000000
RECEIVE_TIMEOUT: 1000000
RECEIVE_DATA_WHEN_STATUS_ERROR: true
run: |
echo "{" >> .env.staging.json
echo "API_BASE_URL:$API_BASE_URL," >> .env.staging.json
echo "CONNECT_TIMEOUT:$CONNECT_TIMEOUT," >> .env.staging.json
echo "SEND_TIMEOUT:$SEND_TIMEOUT," >> .env.staging.json
echo "RECEIVE_TIMEOUT:$RECEIVE_TIMEOUT," >> .env.staging.json
echo "RECEIVE_DATA_WHEN_STATUS_ERROR:$RECEIVE_DATA_WHEN_STATUS_ERROR" >> .env.staging.json
echo "}" >> .env.staging.json
- name: Install Dependencies
run: flutter pub get
- name: Analyze
run: flutter analyze lib
- name: Test
run: flutter test