-
-
Notifications
You must be signed in to change notification settings - Fork 40
89 lines (73 loc) · 3.22 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
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
# This GitHub actions runs on pull request to master, it:
# - Installs Dart and flutter
# - Uses Flutter beta channel for now.
# - Enables flutter web
# - Gets package dependencies
# - Runs dart analyze, allows deprecation warnings, we on purpose allow use of deprecated features on beta channel,
# as they might not yet be deprecated on stable and we will keep using some of the features that are deprecated
# as long as they are not also deprecated on stable.
# - Show outdated packages, just added for info.
# - Verify that dart format is used by all committed code, fails if not. Controversial but pub.dev penalizes you if
# dart format is not used.
# - Run all tests with coverage.
# - Upload code coverage output to Codecov for analysis.
# - Install linux rpl tool. It is used to automate the needed change of a line in index.html.
# - Build default and web example apps for FlexColorPicker.
# - Flutter clean.
# - Flutter build web app, in release mode and with CanvasKit renderer.
# - REMOVED: (Use rpl to fix/modify the index.html file to give it the correct href deployment sub-folder.)
# - This CI/CD stops here, it does not deploy, that is done by the deploy workflow, that is otherwise identical,
# but runs on release, when it is published.
name: Build samples
on:
push:
branches: [none]
paths-ignore:
- "**.md"
pull_request:
branches: [none]
paths-ignore:
- "**.md"
jobs:
tests_build:
name: Analyze, test and build the example and web app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Flutter and Dart SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Show Dart SDK version
run: dart --version
- name: Show Flutter SDK version
run: flutter --version
- name: Flutter Enable Web
run: flutter config --enable-web
- name: Install Flutter package dependencies
run: flutter pub get
- name: Analyze Dart source
run: dart analyze
- name: Show outdated packages
run: flutter pub outdated
- name: Verify that Dart formatting is used, fail if not
run: dart format --output=none --set-exit-if-changed .
- name: Test package FlexColorPicker using test coverage
run: flutter test --coverage
- name: Upload test coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info
- name: Install rpl
run: sudo apt-get install rpl
# Default Example Build
- name: DEFAULT EXAMPLE START BUILD - Flutter clean before build
run: flutter clean && cd example && flutter clean
- name: EXAMPLE WEB release build using CanvasKit
run: cd example && flutter build web --web-renderer=canvaskit --release --target=lib/main.dart
# Web Example Build
- name: WEB EXAMPLE START BUILD - Flutter clean before build
run: flutter clean && cd example && flutter clean
- name: WEB EXAMPLE release build using CanvasKit
run: cd example && flutter build web --web-renderer=canvaskit --base-href "/flexcolorpicker/" --release --target=lib/demo/main.dart