-
Notifications
You must be signed in to change notification settings - Fork 106
70 lines (55 loc) · 1.52 KB
/
main.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
name: ci
on:
push:
paths:
- '**.dart'
- '**.yml'
pull_request:
paths:
- '**.dart'
- '**.yml'
release:
paths:
- '**.dart'
- '**.yml'
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
- name: Flutter unit test
run: flutter test --coverage --coverage-path=lcov.info
- name: Report CodeCov
uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
file: lcov.info
flags: unittests
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup flutter
run: |
git clone https://github.com/flutter/flutter.git -b master --depth 1
./flutter/bin/flutter doctor
./flutter/bin/flutter --version
- name: Enable web
run: ./flutter/bin/flutter config --enable-web
- name: Build web
run: cd example && ../flutter/bin/flutter build web && cd ..
- name: Deploy web To GH-Page
if: github.event_name=='release' && github.event.action=='published'
uses: peaceiris/actions-gh-pages@v2.4.0
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./example/build/web/