-
-
Notifications
You must be signed in to change notification settings - Fork 112
executable file
·104 lines (86 loc) · 2.88 KB
/
ci-develop.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Flutter
on:
push:
branches: [ develop ]
tags-ignore:
- 'v*'
pull_request:
branches: [ develop ]
jobs:
checks:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Java version
uses: actions/setup-java@v1
with:
java-version: '12.x'
- name: Flutter version
uses: subosito/[email protected]
with:
channel: 'stable'
- name: Flutter Stable
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
command: flutter channel stable
- name: Flutter Upgrade
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
command: flutter upgrade
- name: Setup OnePub
env:
ONEPUB_TOKEN: ${{ secrets.ONEPUB_TOKEN }}
run: |
echo "Setting up OnePub..."
mkdir -p $PUB_CACHE/credentials
dart pub global activate onepub
dart pub global run onepub import
echo "Verifying OnePub setup..."
ls -la $PUB_CACHE/credentials/ || echo "Failed to list credentials directory"
cat $PUB_CACHE/credentials/credentials.json || echo "Failed to read credentials file"
# Add pub credentials directly
echo '{
"https://onepub.dev/api/kdpxxpsdav/": {
"token": "${{ secrets.ONEPUB_TOKEN }}"
}
}' > $PUB_CACHE/credentials/credentials.json
- name: Flutter Pub Get
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 2
command: flutter pub get
- name: Check Flutter and Dart versions
run: |
flutter --version
DART_PATH=$(dirname $(which dart))
echo "DART_PATH=$DART_PATH" >> $GITHUB_ENV
- name: Create a dummy .prod.env file
run: echo -e "var BASE_URL = ''; \nvar INIT_TOKEN = '';" > .prod.env
- name: Create a dummy .staging.env file
run: echo -e "var BASE_URL = ''; \nvar INIT_TOKEN = '';" > .staging.env
- name: Run Riverpod generator
run: flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Run Pigeon generator
run: flutter pub run pigeon --input pigeon_conf.dart
- name: Run Unit Tests
run: flutter test --coverage
- name: Upload Test Coverage
uses: codecov/codecov-action@v3
with:
file: coverage/lcov.info
fail_ci_if_error: true
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: flutter-artifacts
path: build/