Skip to content

Commit 6d11bf7

Browse files
authored
ci: Optimize workflows execution time and bump actions to latest (#490)
## Description This PR bumps actions used in workflows to latest versions and optimizes workflows, which can be optimized, by adding concurrency.
1 parent acc2dec commit 6d11bf7

7 files changed

Lines changed: 157 additions & 35 deletions

File tree

.github/workflows/build-examples.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ jobs:
3535
- name: 📦 Install dependencies
3636
run: yarn install --immutable
3737

38-
- name: 🏗️ Build library
39-
run: yarn build
40-
41-
- name: 📱 Install Expo CLI
42-
run: npm install -g @expo/cli
43-
4438
- name: 🌐 Install Expo dependencies
4539
working-directory: example/expo
4640
run: yarn install --immutable
4741

42+
- name: 📱 Install Expo CLI
43+
run: npm install -g @expo/cli
44+
4845
- name: 🔍 Validate Expo configuration
4946
working-directory: example/expo
5047
run: npx expo-doctor
@@ -64,6 +61,9 @@ jobs:
6461
build-react-native:
6562
name: 📱 Build ${{ matrix.app }} (${{ matrix.platform }})
6663
runs-on: macos-15
64+
concurrency:
65+
group: build-react-native-${{ github.ref }}
66+
cancel-in-progress: true
6767
strategy:
6868
matrix:
6969
app: [fabric, paper]
@@ -83,12 +83,13 @@ jobs:
8383
- name: 📦 Install dependencies
8484
run: yarn install --immutable
8585

86-
- name: 🏗️ Build library
87-
run: yarn build
86+
- name: 📱 Install dependencies for ${{ matrix.app }}
87+
working-directory: example/${{ matrix.app }}
88+
run: yarn install --immutable
8889

8990
- name: 🍎 Setup Ruby (iOS only)
9091
if: matrix.platform == 'ios'
91-
uses: ruby/setup-ruby@v1
92+
uses: ruby/setup-ruby@v2
9293
with:
9394
ruby-version: '3.3'
9495
bundler-cache: true
@@ -106,18 +107,14 @@ jobs:
106107

107108
- name: 🤖 Setup Android SDK (Android only)
108109
if: matrix.platform == 'android'
109-
uses: android-actions/setup-android@v3
110-
111-
- name: 📱 Install dependencies for ${{ matrix.app }}
112-
working-directory: example/${{ matrix.app }}
113-
run: yarn install --immutable
110+
uses: android-actions/setup-android@v4
114111

115112
- name: 🍎 Install pods (iOS only)
116113
if: matrix.platform == 'ios'
117114
working-directory: example/${{ matrix.app }}/ios
118115
run: |
119116
bundle install
120-
bundle exec pod update
117+
bundle exec pod install
121118
122119
- name: 🍎 Build iOS
123120
if: matrix.platform == 'ios'
@@ -161,9 +158,6 @@ jobs:
161158
- name: 📦 Install dependencies
162159
run: yarn install --immutable
163160

164-
- name: 🏗️ Build library
165-
run: yarn build
166-
167161
- name: 🌐 Install web dependencies
168162
working-directory: example/web
169163
run: yarn install --immutable

.github/workflows/code_quality_checks.yml

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ on:
99
- main
1010

1111
jobs:
12-
check:
12+
circular-deps:
13+
name: 🔄 Circular Dependencies
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: 🛒 Checkout code
16-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1718

1819
- name: 🔧 Setup Node.js
19-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2021
with:
21-
node-version: 20
22+
node-version: '20'
2223
cache: 'yarn'
2324

2425
- name: 📦 Install dependencies
@@ -28,14 +29,78 @@ jobs:
2829
working-directory: packages/react-native-sortables
2930
run: yarn circular-dependency-check
3031

32+
typecheck:
33+
name: 🔎 TypeScript Check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: 🛒 Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: 🔧 Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '20'
43+
cache: 'yarn'
44+
45+
- name: 📦 Install dependencies
46+
run: yarn install --immutable
47+
3148
- name: 🔎 Run typecheck
3249
run: yarn typecheck
3350

51+
lint:
52+
name: 🧹 ESLint
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: 🛒 Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: 🔧 Setup Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: '20'
62+
cache: 'yarn'
63+
64+
- name: 📦 Install dependencies
65+
run: yarn install --immutable
66+
3467
- name: 🧹 Run lint
3568
run: yarn lint
3669

70+
format:
71+
name: 🎨 Prettier
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: 🛒 Checkout code
75+
uses: actions/checkout@v4
76+
77+
- name: 🔧 Setup Node.js
78+
uses: actions/setup-node@v4
79+
with:
80+
node-version: '20'
81+
cache: 'yarn'
82+
83+
- name: 📦 Install dependencies
84+
run: yarn install --immutable
85+
3786
- name: 🎨 Run Prettier check
3887
run: yarn format:check
3988

89+
test:
90+
name: 🧪 Tests
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: 🛒 Checkout code
94+
uses: actions/checkout@v4
95+
96+
- name: 🔧 Setup Node.js
97+
uses: actions/setup-node@v4
98+
with:
99+
node-version: '20'
100+
cache: 'yarn'
101+
102+
- name: 📦 Install dependencies
103+
run: yarn install --immutable
104+
40105
- name: 🧪 Run tests
41106
run: yarn test

.github/workflows/rebase.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
)
1515
steps:
1616
- name: 🛒 Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020
token: ${{ secrets.GH_TOKEN }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313

1414
steps:
1515
- name: 🛒 Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
token: ${{ secrets.GH_TOKEN }}
2020

21-
- name: 🛠 Setup Node.js
22-
uses: actions/setup-node@v3
21+
- name: 🔧 Setup Node.js
22+
uses: actions/setup-node@v4
2323
with:
24-
node-version: 20
24+
node-version: '20'
2525
cache: 'yarn'
2626

2727
- name: 📦 Install dependencies

.github/workflows/unused-code-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414

1515
steps:
1616
- name: 🛒 Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818

1919
- name: 🔧 Setup Node.js
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
22-
node-version: 20
22+
node-version: '20'
2323
cache: 'yarn'
2424

2525
- name: 📦 Install dependencies

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"@types/eslint": "^9.6.1",
66
"@types/jest": "^29.5.12",
77
"@types/node": "^20.14.9",
8+
"concurrently": "^8.2.2",
89
"eslint": "^9.28.0",
910
"eslint-config-react-native-matipl01": "^3.2.0",
1011
"husky": "^9.1.4",
@@ -47,8 +48,8 @@
4748
"pod": "yarn workspaces foreach -A -p run pod",
4849
"postinstall": "yarn husky:install",
4950
"prepare": "husky",
50-
"test": "yarn lib test && yarn example:app test",
51-
"typecheck": "yarn lib typecheck && yarn example:app typecheck"
51+
"test": "concurrently 'yarn lib test' 'yarn example:app test'",
52+
"typecheck": "concurrently 'yarn lib typecheck' 'yarn example:app typecheck'"
5253
},
5354
"type": "module",
5455
"workspaces": {

yarn.lock

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,13 @@ __metadata:
18961896
languageName: node
18971897
linkType: hard
18981898

1899+
"@babel/runtime@npm:^7.21.0":
1900+
version: 7.28.4
1901+
resolution: "@babel/runtime@npm:7.28.4"
1902+
checksum: 10c0/792ce7af9750fb9b93879cc9d1db175701c4689da890e6ced242ea0207c9da411ccf16dc04e689cc01158b28d7898c40d75598f4559109f761c12ce01e959bf7
1903+
languageName: node
1904+
linkType: hard
1905+
18991906
"@babel/template@npm:^7.25.0, @babel/template@npm:^7.25.9, @babel/template@npm:^7.26.9, @babel/template@npm:^7.3.3":
19001907
version: 7.26.9
19011908
resolution: "@babel/template@npm:7.26.9"
@@ -6991,6 +6998,26 @@ __metadata:
69916998
languageName: node
69926999
linkType: hard
69937000

7001+
"concurrently@npm:^8.2.2":
7002+
version: 8.2.2
7003+
resolution: "concurrently@npm:8.2.2"
7004+
dependencies:
7005+
chalk: "npm:^4.1.2"
7006+
date-fns: "npm:^2.30.0"
7007+
lodash: "npm:^4.17.21"
7008+
rxjs: "npm:^7.8.1"
7009+
shell-quote: "npm:^1.8.1"
7010+
spawn-command: "npm:0.0.2"
7011+
supports-color: "npm:^8.1.1"
7012+
tree-kill: "npm:^1.2.2"
7013+
yargs: "npm:^17.7.2"
7014+
bin:
7015+
conc: dist/bin/concurrently.js
7016+
concurrently: dist/bin/concurrently.js
7017+
checksum: 10c0/0e9683196fe9c071d944345d21d8f34aa6c0cc50c0dd897e95619f2f1c9eb4871dca851b2569da17888235b7335b4c821ca19deed35bebcd9a131ee5d247f34c
7018+
languageName: node
7019+
linkType: hard
7020+
69947021
"config-chain@npm:^1.1.11":
69957022
version: 1.1.13
69967023
resolution: "config-chain@npm:1.1.13"
@@ -7313,6 +7340,15 @@ __metadata:
73137340
languageName: node
73147341
linkType: hard
73157342

7343+
"date-fns@npm:^2.30.0":
7344+
version: 2.30.0
7345+
resolution: "date-fns@npm:2.30.0"
7346+
dependencies:
7347+
"@babel/runtime": "npm:^7.21.0"
7348+
checksum: 10c0/e4b521fbf22bc8c3db332bbfb7b094fd3e7627de0259a9d17c7551e2d2702608a7307a449206065916538e384f37b181565447ce2637ae09828427aed9cb5581
7349+
languageName: node
7350+
linkType: hard
7351+
73167352
"dayjs@npm:^1.8.15":
73177353
version: 1.11.13
73187354
resolution: "dayjs@npm:1.11.13"
@@ -14901,6 +14937,7 @@ __metadata:
1490114937
"@types/eslint": "npm:^9.6.1"
1490214938
"@types/jest": "npm:^29.5.12"
1490314939
"@types/node": "npm:^20.14.9"
14940+
concurrently: "npm:^8.2.2"
1490414941
eslint: "npm:^9.28.0"
1490514942
eslint-config-react-native-matipl01: "npm:^3.2.0"
1490614943
husky: "npm:^9.1.4"
@@ -15638,6 +15675,15 @@ __metadata:
1563815675
languageName: node
1563915676
linkType: hard
1564015677

15678+
"rxjs@npm:^7.8.1":
15679+
version: 7.8.2
15680+
resolution: "rxjs@npm:7.8.2"
15681+
dependencies:
15682+
tslib: "npm:^2.1.0"
15683+
checksum: 10c0/1fcd33d2066ada98ba8f21fcbbcaee9f0b271de1d38dc7f4e256bfbc6ffcdde68c8bfb69093de7eeb46f24b1fb820620bf0223706cff26b4ab99a7ff7b2e2c45
15684+
languageName: node
15685+
linkType: hard
15686+
1564115687
"safe-array-concat@npm:^1.1.3":
1564215688
version: 1.1.3
1564315689
resolution: "safe-array-concat@npm:1.1.3"
@@ -16268,6 +16314,13 @@ __metadata:
1626816314
languageName: node
1626916315
linkType: hard
1627016316

16317+
"spawn-command@npm:0.0.2":
16318+
version: 0.0.2
16319+
resolution: "spawn-command@npm:0.0.2"
16320+
checksum: 10c0/b22f2d71239e6e628a400831861ba747750bbb40c0a53323754cf7b84330b73d81e40ff1f9055e6d1971818679510208a9302e13d9ff3b32feb67e74d7a1b3ef
16321+
languageName: node
16322+
linkType: hard
16323+
1627116324
"spawn-error-forwarder@npm:~1.0.0":
1627216325
version: 1.0.0
1627316326
resolution: "spawn-error-forwarder@npm:1.0.0"
@@ -16779,7 +16832,7 @@ __metadata:
1677916832
languageName: node
1678016833
linkType: hard
1678116834

16782-
"supports-color@npm:^8.0.0":
16835+
"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1":
1678316836
version: 8.1.1
1678416837
resolution: "supports-color@npm:8.1.1"
1678516838
dependencies:
@@ -17084,6 +17137,15 @@ __metadata:
1708417137
languageName: node
1708517138
linkType: hard
1708617139

17140+
"tree-kill@npm:^1.2.2":
17141+
version: 1.2.2
17142+
resolution: "tree-kill@npm:1.2.2"
17143+
bin:
17144+
tree-kill: cli.js
17145+
checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2
17146+
languageName: node
17147+
linkType: hard
17148+
1708717149
"treeverse@npm:^3.0.0":
1708817150
version: 3.0.0
1708917151
resolution: "treeverse@npm:3.0.0"
@@ -17240,7 +17302,7 @@ __metadata:
1724017302
languageName: node
1724117303
linkType: hard
1724217304

17243-
"tslib@npm:2.8.1, tslib@npm:^2.4.0":
17305+
"tslib@npm:2.8.1, tslib@npm:^2.1.0, tslib@npm:^2.4.0":
1724417306
version: 2.8.1
1724517307
resolution: "tslib@npm:2.8.1"
1724617308
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62
@@ -18297,7 +18359,7 @@ __metadata:
1829718359
languageName: node
1829818360
linkType: hard
1829918361

18300-
"yargs@npm:^17.3.1, yargs@npm:^17.5.1, yargs@npm:^17.6.2":
18362+
"yargs@npm:^17.3.1, yargs@npm:^17.5.1, yargs@npm:^17.6.2, yargs@npm:^17.7.2":
1830118363
version: 17.7.2
1830218364
resolution: "yargs@npm:17.7.2"
1830318365
dependencies:

0 commit comments

Comments
 (0)