Skip to content

Commit 08990cc

Browse files
ci(core): adjust CI and CD
1 parent db603af commit 08990cc

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

.github/workflows/CI-CD.yaml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ jobs:
1515

1616
- name: cache node_modules
1717
id: cache-node-modules
18-
uses: actions/cache@v2
18+
uses: actions/cache@v3
1919
with:
2020
path: '**/node_modules'
2121
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}
2222

23-
- name: Use Node ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
23+
- name: Use Node 16
24+
uses: actions/setup-node@v3
2525
with:
26-
node-version: ${{ matrix.node-version }}
27-
28-
- run: git fetch --no-tags --prune --depth=5 origin main
26+
node-version: 16
2927

3028
- name: Install deps
3129
if: steps.cache-node-modules.cache-hit != 'true'
3230
run: npm install
3331

34-
- name: Install Flutter
35-
uses: subosito/flutter-action@v2
32+
- name: Cache Flutter dependencies
33+
uses: actions/cache@v3
3634
with:
37-
channel: 'stable'
38-
cache-key: ${{ runner.os }}-flutter
39-
architecture: x64
35+
path: /opt/hostedtoolcache/flutter
36+
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
37+
- uses: subosito/flutter-action@v2
38+
with:
39+
flutter-version: ${{ env.FLUTTER_VERSION }}
4040
- run: flutter --version
4141

4242
build_appbundle:
@@ -49,23 +49,25 @@ jobs:
4949
fetch-depth: 0
5050

5151
- name: cache node_modules
52-
uses: actions/cache@v2
52+
uses: actions/cache@v3
5353
with:
5454
path: '**/node_modules'
5555
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}
5656

5757
- name: Cache Flutter dependencies
58-
uses: actions/cache@v2
58+
uses: actions/cache@v3
5959
with:
6060
path: /opt/hostedtoolcache/flutter
61-
key: ${{ runner.os }}-flutter
61+
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
6262
- uses: subosito/flutter-action@v2
6363
with:
64-
channel: 'stable'
64+
flutter-version: ${{ env.FLUTTER_VERSION }}
65+
6566
- name: Flutter appbundle
66-
run: npx nx run flutter-suflex:build-appbundle
67+
run: npx nx run flutter-rick-morty:build-appbundle
68+
6769
- name: Upload appbundle
6870
uses: actions/upload-artifact@v3
6971
with:
7072
name: appbundle
71-
path: apps/flutter/suflex/build/app/outputs/bundle/release/app-release.aab
73+
path: apps/flutter/rick-morty/build/app/outputs/bundle/release/app-release.aab

.github/workflows/CI.yaml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
types: [opened, reopenned, ready_for_review, edited, synchronize]
66
branches: [main]
77

8+
env:
9+
FLUTTER_VERSION: "3.0.5"
10+
JAVA_VERSION: "12.x"
11+
812
jobs:
913
prepare:
1014
runs-on: ubuntu-latest
@@ -15,28 +19,28 @@ jobs:
1519

1620
- name: cache node_modules
1721
id: cache-node-modules
18-
uses: actions/cache@v2
22+
uses: actions/cache@v3
1923
with:
2024
path: '**/node_modules'
2125
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}
2226

23-
- name: Use Node ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
27+
- name: Use Node 16
28+
uses: actions/setup-node@v3
2529
with:
26-
node-version: ${{ matrix.node-version }}
27-
28-
- run: git fetch --no-tags --prune --depth=5 origin main
30+
node-version: 16
2931

3032
- name: Install deps
3133
if: steps.cache-node-modules.cache-hit != 'true'
3234
run: npm install
3335

34-
- name: Install Flutter
35-
uses: subosito/flutter-action@v2
36+
- name: Cache Flutter dependencies
37+
uses: actions/cache@v3
3638
with:
37-
channel: 'stable'
38-
cache-key: ${{ runner.os }}-flutter
39-
architecture: x64
39+
path: /opt/hostedtoolcache/flutter
40+
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
41+
- uses: subosito/flutter-action@v2
42+
with:
43+
flutter-version: ${{ env.FLUTTER_VERSION }}
4044
- run: flutter --version
4145

4246
analyze:
@@ -48,21 +52,23 @@ jobs:
4852
fetch-depth: 0
4953

5054
- name: cache node_modules
51-
uses: actions/cache@v2
55+
uses: actions/cache@v3
5256
with:
5357
path: '**/node_modules'
5458
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}
5559

5660
- name: Cache Flutter dependencies
57-
uses: actions/cache@v2
61+
uses: actions/cache@v3
5862
with:
5963
path: /opt/hostedtoolcache/flutter
60-
key: ${{ runner.os }}-flutter
64+
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
6165
- uses: subosito/flutter-action@v2
6266
with:
63-
channel: 'stable'
67+
flutter-version: ${{ env.FLUTTER_VERSION }}
68+
6469
- name: Flutter analyze
6570
run: npx nx run-many --target=analyze --all=true
71+
6672
- name: Flutter format
6773
run: npx nx run-many --target=format --all=true
6874

@@ -75,18 +81,19 @@ jobs:
7581
fetch-depth: 0
7682

7783
- name: cache node_modules
78-
uses: actions/cache@v2
84+
uses: actions/cache@v3
7985
with:
8086
path: '**/node_modules'
8187
key: ${{ runner.os }}-build-node-modules-cache-${{ hashFiles('package-lock.json') }}
8288

8389
- name: Cache Flutter dependencies
84-
uses: actions/cache@v2
90+
uses: actions/cache@v3
8591
with:
8692
path: /opt/hostedtoolcache/flutter
87-
key: ${{ runner.os }}-flutter
93+
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }}
8894
- uses: subosito/flutter-action@v2
8995
with:
90-
channel: 'stable'
96+
flutter-version: ${{ env.FLUTTER_VERSION }}
97+
9198
- name: Flutter test
92-
run: npx nx run-many --target=test --all=true --exclude=flutter-api,flutter-episodes,flutter-characters,flutter-suflex,flutter-splash
99+
run: npx nx run flutter-shared:test

0 commit comments

Comments
 (0)