generated from GabrielGodoy01/template_flutter_clean_architecture
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 2.55 KB
/
flutter_CI.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Flutter CI TEST
on:
pull_request:
branches: [dev]
jobs:
flutter_test:
name: Run flutter test
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Java Version
uses: actions/setup-java@v1
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
- name: Get flutter dependencies
run: flutter pub get
- name: Setup AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: sa-east-1
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GithubActionsRole
role-session-name: github-action
- run: npm install -g @aws-amplify/cli
- name: Setup Amplify projects
run: |
AWSCLOUDFORMATIONCONFIG="{\
\"configLevel\":\"general\",\
\"useProfile\":true,\
\"profileName\":\"default\",\
\"accessKeyId\":\"${{ env.AWS_ACCESS_KEY_ID}}\",\
\"secretAccessKey\":\"${{ env.AWS_SECRET_ACCESS_KEY}}\",\
\"region\":\"sa-east-1\"\
}"
CONFIG="{\
\"ResDir\":\"lib\"\
}"
FRONTEND="{\
\"frontend\":\"flutter\",\
\"config\":$CONFIG\
}"
AMPLIFY="{\
\"projectName\":\"${{ secrets.AMPLIFY_AUTH_PROJECT }}\",\
\"appId\":\"${{ secrets.AMPLIFY_AUTH_APP_ID }}\",\
\"envName\":\"dev\",\
\"defaultEditor\":\"code\"\
}"
PROVIDERS="{\
\"awscloudformation\":$AWSCLOUDFORMATIONCONFIG\
}"
amplify pull --amplify $AMPLIFY --frontend $FRONTEND --providers $PROVIDERS --yes
# Report:
- name: Install lcov
run: sudo apt-get install lcov
- name: Flutter Test
run: flutter test --coverage
- name: Create report
run: genhtml coverage/lcov.info -o coverage/html
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: coverage/lcov.info
flags: unittests # optional
directory: coverage/
functionalities: html
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- uses: actions/upload-artifact@v2
with:
name: report
path: coverage/html/