Skip to content

Commit 28499e6

Browse files
committed
CI
1 parent 199a0c4 commit 28499e6

File tree

2 files changed

+254
-0
lines changed

2 files changed

+254
-0
lines changed

.github/workflows/build-firebase.yaml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
name: build firebase
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the develop branch
5+
on:
6+
push:
7+
branches: [develop, main]
8+
paths:
9+
- "flutter_cache_manager_firebase/**"
10+
- ".github/workflows/**"
11+
pull_request:
12+
branches: [develop]
13+
paths:
14+
- "flutter_cache_manager_firebase/**"
15+
- ".github/workflows/**"
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
format:
20+
name: Format
21+
22+
# The type of runner that the job will run on
23+
runs-on: ubuntu-latest
24+
25+
env:
26+
source-directory: ./flutter_cache_manager_firebase_firebase
27+
28+
# Steps represent a sequence of tasks that will be executed as part of the job
29+
steps:
30+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31+
- uses: actions/checkout@v4
32+
33+
# Make sure the stable version of Flutter is available
34+
- name: Set up Flutter
35+
uses: subosito/flutter-action@v2
36+
with:
37+
channel: "stable"
38+
architecture: x64
39+
cache: true
40+
41+
# Download all Flutter packages
42+
- name: Download dependencies
43+
run: flutter pub get
44+
working-directory: ${{env.source-directory}}
45+
46+
# Run Flutter Format to ensure formatting is valid
47+
- name: Run Flutter Format
48+
run: dart format --set-exit-if-changed .
49+
working-directory: ${{env.source-directory}}
50+
51+
analyze:
52+
name: Analyze
53+
54+
# The type of runner that the job will run on
55+
runs-on: ubuntu-latest
56+
57+
env:
58+
source-directory: ./flutter_cache_manager_firebase
59+
60+
# Steps represent a sequence of tasks that will be executed as part of the job
61+
steps:
62+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
63+
- uses: actions/checkout@v4
64+
65+
# Make sure the stable version of Flutter is available
66+
- name: Set up Flutter
67+
uses: subosito/flutter-action@v2
68+
with:
69+
channel: "stable"
70+
architecture: x64
71+
cache: true
72+
73+
# Download all Flutter packages
74+
- name: Download dependencies
75+
run: flutter pub get
76+
working-directory: ${{env.source-directory}}
77+
78+
# Run Flutter Analyzer
79+
- name: Run Flutter Analyzer
80+
run: flutter analyze
81+
working-directory: ${{env.source-directory}}
82+
83+
tests:
84+
name: Unit-tests
85+
# The type of runner that the job will run on
86+
runs-on: ubuntu-latest
87+
88+
env:
89+
source-directory: ./flutter_cache_manager_firebase
90+
91+
# Steps represent a sequence of tasks that will be executed as part of the job
92+
steps:
93+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
94+
- uses: actions/checkout@v4
95+
96+
# Make sure the stable version of Flutter is available
97+
- name: Set up Flutter
98+
uses: subosito/flutter-action@v2
99+
with:
100+
channel: "stable"
101+
architecture: x64
102+
cache: true
103+
104+
# Download all Flutter packages
105+
- name: Download dependencies
106+
run: flutter pub get
107+
working-directory: ${{env.source-directory}}
108+
109+
# Run all unit-tests with code coverage
110+
- name: Run unit tests
111+
run: flutter test --coverage
112+
working-directory: ${{env.source-directory}}
113+
114+
# # Upload code coverage information
115+
# - uses: codecov/codecov-action@v4
116+
# env:
117+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
118+
# with:
119+
# files: ${{env.source-directory}}/coverage/lcov.info
120+
# name: CacheManager
121+
# fail_ci_if_error: true
122+
123+
publish_cache_manager_firebase:
124+
if: ${{ github.ref_type == 'tag' }}
125+
name: Publish Cache Manager Firebase
126+
permissions:
127+
id-token: write
128+
needs: [format, analyze, tests]
129+
# The type of runner that the job will run on
130+
runs-on: ubuntu-latest
131+
132+
env:
133+
source-directory: ./flutter_cache_manager_firebase
134+
135+
# Steps represent a sequence of tasks that will be executed as part of the job
136+
steps:
137+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
138+
- uses: actions/checkout@v4
139+
140+
- name: Set up Dart
141+
uses: dart-lang/setup-dart@v1
142+
143+
# Make sure the stable version of Flutter is available
144+
- name: Set up Flutter
145+
uses: subosito/flutter-action@v2
146+
with:
147+
channel: "stable"
148+
architecture: x64
149+
cache: true
150+
151+
# Download all Flutter packages
152+
- name: Download dependencies
153+
run: flutter pub get
154+
working-directory: ${{env.source-directory}}
155+
156+
# Publish the package
157+
- name: Publish package
158+
run: dart pub publish -v -f

.github/workflows/build.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,99 @@ jobs:
347347
# files: ${{env.source-directory}}/coverage/lcov.info
348348
# name: CacheManager
349349
# fail_ci_if_error: true
350+
351+
publish_cache_manager:
352+
if: ${{ github.ref_type == 'tag' }}
353+
name: Publish CacheManager
354+
permissions:
355+
id-token: write
356+
needs:
357+
[
358+
format,
359+
analyze,
360+
tests,
361+
build_android,
362+
build_ios,
363+
build_macOS,
364+
build_windows,
365+
build_linux,
366+
build_web,
367+
]
368+
# The type of runner that the job will run on
369+
runs-on: ubuntu-latest
370+
371+
env:
372+
source-directory: ./flutter_cache_manager
373+
374+
# Steps represent a sequence of tasks that will be executed as part of the job
375+
steps:
376+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
377+
- uses: actions/checkout@v4
378+
379+
- name: Set up Dart
380+
uses: dart-lang/setup-dart@v1
381+
382+
# Make sure the stable version of Flutter is available
383+
- name: Set up Flutter
384+
uses: subosito/flutter-action@v2
385+
with:
386+
channel: "stable"
387+
architecture: x64
388+
cache: true
389+
390+
# Download all Flutter packages
391+
- name: Download dependencies
392+
run: flutter pub get
393+
working-directory: ${{env.source-directory}}
394+
395+
# Publish the package
396+
- name: Publish package
397+
run: dart pub publish -v -f
398+
399+
publish_cache_manager_firebase:
400+
if: ${{ github.ref_type == 'tag' }}
401+
name: Publish Cache Manager Firebase
402+
permissions:
403+
id-token: write
404+
needs:
405+
[
406+
format,
407+
analyze,
408+
tests,
409+
build_android,
410+
build_ios,
411+
build_macOS,
412+
build_windows,
413+
build_linux,
414+
build_web,
415+
]
416+
# The type of runner that the job will run on
417+
runs-on: ubuntu-latest
418+
419+
env:
420+
source-directory: ./flutter_cache_manager_firebase
421+
422+
# Steps represent a sequence of tasks that will be executed as part of the job
423+
steps:
424+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
425+
- uses: actions/checkout@v4
426+
427+
- name: Set up Dart
428+
uses: dart-lang/setup-dart@v1
429+
430+
# Make sure the stable version of Flutter is available
431+
- name: Set up Flutter
432+
uses: subosito/flutter-action@v2
433+
with:
434+
channel: "stable"
435+
architecture: x64
436+
cache: true
437+
438+
# Download all Flutter packages
439+
- name: Download dependencies
440+
run: flutter pub get
441+
working-directory: ${{env.source-directory}}
442+
443+
# Publish the package
444+
- name: Publish package
445+
run: dart pub publish -v -f

0 commit comments

Comments
 (0)