Skip to content

Commit da3b5b7

Browse files
okwasniewskikrozniataPiotr Trocki
authored
chore: move to github actions (#635)
* chore: move to github actions * fix: unify CI to one file * chore: upgrade react-native to fix building issues * fix: keep consistency across steps Co-authored-by: Kacper Rożniata <[email protected]> * chore: bump reanimated * chore: remove patch package * fix: rename step to be more descriptive Co-authored-by: Kacper Rożniata <[email protected]> * fix: rename fabric step to be more descriptive Co-authored-by: Kacper Rożniata <[email protected]> * chore: add canceling previous job on push * chore: test job cancelling * chore: change arch to speed up building on android * feat: split CI into multiple files * feat: reuse action in jobs * fix: change ios build command Co-authored-by: Kacper Rożniata <[email protected]> Co-authored-by: Piotr Trocki <[email protected]>
1 parent 03fe6b1 commit da3b5b7

File tree

11 files changed

+703
-794
lines changed

11 files changed

+703
-794
lines changed

.circleci/config.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Install dependencies
2+
description: "Installs and caches the dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install dependencies
8+
shell: bash
9+
run: yarn install
10+
11+
- name: Cache
12+
uses: actions/cache@v3
13+
with:
14+
path: ./node_modules
15+
key: ${{ hashFiles('./package.json') }}
16+
17+
- name: Cache example node modules
18+
id: cache-example-npm
19+
uses: actions/cache@v3
20+
env:
21+
cache-name: cached-example-npm-deps
22+
with:
23+
path: example/node_modules
24+
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
25+
26+
- name: Install required example dependencies on yarn.lock change
27+
if: steps.cache-example-npm.outputs.cache-hit != 'true'
28+
shell: bash
29+
run: yarn install
30+
working-directory: example
31+
32+
- name: Cache fabric example node modules
33+
id: cache-fabricexample-npm
34+
uses: actions/cache@v3
35+
env:
36+
cache-name: cached-fabric-npm-deps
37+
with:
38+
path: fabricexample/node_modules
39+
key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
40+
41+
- name: Install required fabric example dependencies on yarn.lock change
42+
if: steps.cache-fabricexample-npm.outputs.cache-hit != 'true'
43+
shell: bash
44+
run: yarn install
45+
working-directory: fabricexample

.github/workflows/android.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Android Build
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/android.yml'
7+
- 'android/**'
8+
- 'example/android/**'
9+
- 'fabricexample/android/**'
10+
11+
12+
concurrency:
13+
group: ${{ github.ref }}-android
14+
cancel-in-progress: true
15+
16+
jobs:
17+
android-build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: ./.github/actions/install-dependencies
22+
23+
- name: Pull dependencies
24+
uses: actions/cache@v3
25+
with:
26+
path: ./node_modules
27+
key: ${{ hashFiles('./package.json') }}
28+
29+
- name: Cache example node modules
30+
id: cache-example-npm
31+
uses: actions/cache@v3
32+
env:
33+
cache-name: cached-example-npm-deps
34+
with:
35+
path: example/node_modules
36+
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
37+
38+
- uses: actions/setup-java@v3
39+
with:
40+
distribution: "zulu"
41+
java-version: "11"
42+
43+
- name: Build Android
44+
run: ./gradlew assembleDebug
45+
working-directory: example/android
46+
47+
android-build-fabric:
48+
runs-on: ubuntu-latest
49+
needs: android-build
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: ./.github/actions/install-dependencies
53+
54+
- name: Pull dependencies
55+
uses: actions/cache@v3
56+
with:
57+
path: ./node_modules
58+
key: ${{ hashFiles('./package.json') }}
59+
60+
- name: Cache fabric example node modules
61+
id: cache-fabricexample-npm
62+
uses: actions/cache@v3
63+
env:
64+
cache-name: cached-fabric-npm-deps
65+
with:
66+
path: fabricexample/node_modules
67+
key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
68+
69+
- uses: actions/setup-java@v3
70+
with:
71+
distribution: "zulu"
72+
java-version: "11"
73+
74+
- name: Build Android (Fabric)
75+
run: ./gradlew assembleDebug -PreactNativeArchitectures=arm64-v8a
76+
working-directory: fabricexample/android

.github/workflows/ios.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: iOS Build
2+
3+
on:
4+
push:
5+
paths:
6+
- '.github/workflows/ios.yml'
7+
- 'ios/**'
8+
- 'example/ios/**'
9+
- 'fabricexample/ios/**'
10+
11+
concurrency:
12+
group: ${{ github.ref }}-ios
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ios-build:
17+
runs-on: macos-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: ./.github/actions/install-dependencies
21+
22+
- name: Pull dependencies
23+
uses: actions/cache@v3
24+
with:
25+
path: ./node_modules
26+
key: ${{ hashFiles('./package.json') }}
27+
28+
- name: Cache example node modules
29+
id: cache-example-npm
30+
uses: actions/cache@v3
31+
env:
32+
cache-name: cached-example-npm-deps
33+
with:
34+
path: example/node_modules
35+
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
36+
37+
- name: Cache Pods
38+
id: cache-pods
39+
uses: actions/cache@v3
40+
env:
41+
cache-name: cached-ios-pods-deps
42+
with:
43+
path: example/ios/Pods
44+
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
45+
46+
- name: Install required dependencies on cache miss (Pods)
47+
if: steps.cache-pods.outputs.cache-hit != 'true'
48+
run: pod install
49+
working-directory: example/ios
50+
51+
- name: Reinstall Pods only if using cached ones
52+
if: steps.cache-pods.outputs.cache-hit == 'true'
53+
run: pod install
54+
working-directory: example/ios
55+
56+
- name: Build iOS
57+
run: xcodebuild -scheme PagerViewExample -workspace PagerViewExample.xcworkspace -sdk iphonesimulator -configuration Debug COMPILER_INDEX_STORE_ENABLE=NO
58+
working-directory: example/ios
59+
60+
ios-build-fabric:
61+
needs: ios-build
62+
runs-on: macos-latest
63+
steps:
64+
- uses: actions/checkout@v3
65+
- uses: ./.github/actions/install-dependencies
66+
67+
- name: Pull dependencies
68+
uses: actions/cache@v3
69+
with:
70+
path: ./node_modules
71+
key: ${{ hashFiles('./package.json') }}
72+
73+
- name: Cache fabric example node modules
74+
id: cache-fabricexample-npm
75+
uses: actions/cache@v3
76+
env:
77+
cache-name: cached-fabric-npm-deps
78+
with:
79+
path: fabricexample/node_modules
80+
key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
81+
82+
- name: Cache FabricExample Pods
83+
id: cache-pods-fabric
84+
uses: actions/cache@v3
85+
env:
86+
cache-name: cached-ios-pods-deps-fabric
87+
with:
88+
path: fabricexample/ios/Pods
89+
key: ${{ hashFiles('./fabricexample/ios/Podfile.lock') }}
90+
91+
- name: Install FabricExample required dependencies on cache miss (Pods)
92+
if: steps.cache-pods-fabric.outputs.cache-hit != 'true'
93+
run: pod install
94+
working-directory: fabricexample/ios
95+
96+
- name: Reinstall FabricExample Pods only if using cached ones
97+
if: steps.cache-pods-fabric.outputs.cache-hit == 'true'
98+
run: pod install
99+
working-directory: fabricexample/ios
100+
101+
- name: Build iOS (Fabric)
102+
run: xcodebuild -scheme FabricExample -workspace FabricExample.xcworkspace -sdk iphonesimulator -configuration Debug COMPILER_INDEX_STORE_ENABLE=NO
103+
working-directory: fabricexample/ios

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Lint
2+
3+
on: [push]
4+
5+
concurrency:
6+
group: ${{ github.ref }}-js
7+
cancel-in-progress: true
8+
9+
jobs:
10+
install-dependencies:
11+
name: Install dependencies
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
- name: Install dependencies
17+
uses: ./.github/actions/install-dependencies
18+
19+
verify-package-source:
20+
name: Lint package
21+
runs-on: ubuntu-latest
22+
needs: install-dependencies
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: Pull dependencies
28+
uses: actions/cache@v3
29+
with:
30+
path: ./node_modules
31+
key: ${{ hashFiles('./package.json') }}
32+
33+
- name: Pull example node modules
34+
id: cache-example-npm
35+
uses: actions/cache@v3
36+
env:
37+
cache-name: cached-example-npm-deps
38+
with:
39+
path: example/node_modules
40+
key: ${{ hashFiles('./example/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
41+
42+
- name: Pull fabric example node modules
43+
id: cache-fabricexample-npm
44+
uses: actions/cache@v3
45+
env:
46+
cache-name: cached-fabric-npm-deps
47+
with:
48+
path: fabricexample/node_modules
49+
key: ${{ hashFiles('./fabricexample/yarn.lock') }}-${{ hashFiles('./yarn.lock') }}
50+
51+
- name: Lint files
52+
run: yarn lint
53+
54+
- name: Typecheck files
55+
run: yarn typescript
56+
57+
- name: Build package
58+
run: yarn prepare

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"@react-navigation/native-stack": "5.0.4",
1616
"@react-navigation/stack": "^5.12.8",
1717
"react": "18.1.0",
18-
"react-native": "0.70.0",
18+
"react-native": "0.70.5",
1919
"react-native-animated-pagination-dots": "^0.1.73",
2020
"react-native-gesture-handler": "^1.9.0",
21-
"react-native-reanimated": "^2.3.1",
21+
"react-native-reanimated": "2.12.0",
2222
"react-native-safe-area-context": "^3.1.9",
2323
"react-native-screens": "^2.16.1",
2424
"react-native-svg": "12.4.4",

0 commit comments

Comments
 (0)