Skip to content

Commit

Permalink
ci: turbo works with single package mode and will be cached correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mym0404 committed Apr 27, 2024
1 parent 8353857 commit e50defb
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 48 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run ci:android:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'ci:android:build:${{matrix.arch}}').cache.status")
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run ci:android:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json --single-package)).tasks.find(t => t.task === 'ci:android:build:${{matrix.arch}}').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run ci:android:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn turbo run ci:android:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }} --single-package"
build-ios:
runs-on: macos-latest
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run ci:ios:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'ci:ios:build:${{matrix.arch}}').cache.status")
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run ci:ios:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json --single-package)).tasks.find(t => t.task === 'ci:ios:build:${{matrix.arch}}').cache.status")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
Expand All @@ -179,4 +179,4 @@ jobs:

- name: Build example for iOS
run: |
yarn turbo run ci:ios:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }}"
yarn turbo run ci:ios:build:${{matrix.arch}} --cache-dir="${{ env.TURBO_CACHE_DIR }} --single-package"
6 changes: 1 addition & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
"typecheck": "tsc --noEmit",
"theme:gen": "generate-theme-type src/design/AppTheme.ts ./../node_modules/@react-native-styled-system/core/lib/typescript/src/@types/ThemedTypings.d.ts",
"pod:old": "cd ios && bundle install && RCT_NEW_ARCH_ENABLED=0 bundle exec pod install",
"pod:new": "cd ios && bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
"ci:android:build:new": "./../script/ci-android-build.sh",
"ci:android:build:old": "./../script/ci-android-build.sh",
"ci:ios:build:new": "./../script/ci-ios-build.sh",
"ci:ios:build:old": "./../script/ci-ios-build.sh"
"pod:new": "cd ios && bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install"
},
"dependencies": {
"@mj-studio/js-util": "^1.0.34",
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
"codegen:android": "cd example/android && ./gradlew generateCodegenArtifactsFromSchema",
"codegen:ios": "node node_modules/react-native/scripts/generate-codegen-artifacts.js --path example/ --outputPath example/ios",
"codegen": "yarn codegen:android && yarn codegen:ios",
"watchman-refresh": "watchman watch-del $(pwd) ; watchman watch-project $(pwd)"
"watchman-refresh": "watchman watch-del $(pwd) ; watchman watch-project $(pwd)",
"ci:android:build:new": "script/ci-android-build.sh",
"ci:android:build:old": "script/ci-android-build.sh",
"ci:ios:build:new": "script/ci-ios-build.sh",
"ci:ios:build:old": "script/ci-ios-build.sh"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 mym0404
Copyright (c) 2024 MJ Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"typescript",
"javascript",
"react",
"expo"
"expo",
"kakao-login",
"kakao-auth"
],
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/navi/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 mym0404
Copyright (c) 2024 MJ Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion packages/share/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 mym0404
Copyright (c) 2024 MJ Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion packages/social/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 mym0404
Copyright (c) 2024 MJ Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion packages/user/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 mym0404
Copyright (c) 2024 MJ Studio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
2 changes: 1 addition & 1 deletion script/ci-android-build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

cd android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a
cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a
2 changes: 1 addition & 1 deletion script/ci-ios-build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

cd ios && xcodebuild -workspace KakaoExample.xcworkspace -scheme KakaoExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO
cd example/ios && xcodebuild -workspace KakaoExample.xcworkspace -scheme KakaoExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO
48 changes: 18 additions & 30 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,67 @@
"pipeline": {
"ci:android:build:new": {
"inputs": [
"package.json",
"android",
"!android/build",
"packages/*/src",
"packages/*/android",
"packages/*/package.json",
"packages/**/src",
"packages/**/android",
"packages/core/expo-config-plugin",
"example/package.json",
"example/android",
"!example/android/.gradle",
"!example/android/build",
"!example/android/app/build",
"!packages/*/lib",
"!packages/*/android/build"
"!packages/**/lib",
"!packages/**/android/build",
"**/package.json"
],
"outputs": []
},
"ci:android:build:old": {
"inputs": [
"package.json",
"android",
"!android/build",
"packages/*/src",
"packages/*/android",
"packages/*/package.json",
"packages/**/src",
"packages/**/android",
"packages/core/expo-config-plugin",
"example/package.json",
"example/android",
"!example/android/.gradle",
"!example/android/build",
"!example/android/app/build",
"!packages/*/lib",
"!packages/*/android/build"
"!packages/**/lib",
"!packages/**/android/build",
"**/package.json"
],
"outputs": []
},
"ci:ios:build:new": {
"inputs": [
"package.json",
"packages/**/*.podspec",
"!android/build",
"packages/*/src",
"packages/*/ios",
"packages/*/package.json",
"packages/**/src",
"packages/**/ios",
"packages/core/expo-config-plugin",
"example/package.json",
"example/ios",
"!example/android/.gradle",
"!example/android/build",
"!example/android/app/build",
"!example/ios/build",
"!example/ios/Pods",
"!packages/*/lib"
"!packages/**/lib",
"**/package.json"
],
"outputs": []
},
"ci:ios:build:old": {
"inputs": [
"package.json",
"packages/**/*.podspec",
"!android/build",
"packages/*/src",
"packages/*/ios",
"packages/*/package.json",
"packages/**/src",
"packages/**/ios",
"packages/core/expo-config-plugin",
"example/package.json",
"example/ios",
"!example/android/.gradle",
"!example/android/build",
"!example/android/app/build",
"!example/ios/build",
"!example/ios/Pods",
"!packages/*/lib"
"!packages/**/lib",
"**/package.json"
],
"outputs": []
}
Expand Down

0 comments on commit e50defb

Please sign in to comment.