Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up ci scripts #212

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 0 additions & 186 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,66 +14,6 @@ jobs:
- name: Typecheck files
run: yarn typecheck

# build-android:
# runs-on: ubuntu-latest
# env:
# TURBO_CACHE_DIR: .turbo/android
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Turn off addons
# run: |
# node ./scripts/turnOffEverything.js

# - name: Setup
# uses: ./.github/actions/setup

# - name: Cache turborepo for Android
# uses: actions/cache@v4
# with:
# path: ${{ env.TURBO_CACHE_DIR }}
# key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-turborepo-android-

# - name: Check turborepo cache for Android
# run: |
# TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:android:release --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:android:release').cache.status")

# if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
# echo "turbo_cache_hit=1" >> $GITHUB_ENV
# fi

# - name: Install JDK
# if: env.turbo_cache_hit != 1
# uses: actions/setup-java@v3
# with:
# distribution: 'zulu'
# java-version: '17'

# - name: Finalize Android SDK
# if: env.turbo_cache_hit != 1
# run: |
# /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

# - name: Cache Gradle
# if: env.turbo_cache_hit != 1
# uses: actions/cache@v4
# with:
# path: |
# ~/.gradle/wrapper
# ~/.gradle/caches
# key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-

# - name: Build example for Android
# env:
# JAVA_OPTS: '-XX:MaxHeapSize=6g'
# run: |
# yarn turbo run run:android:release --cache-dir="${{ env.TURBO_CACHE_DIR }}"

test-android:
runs-on: ubuntu-latest
env:
Expand All @@ -89,22 +29,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:android:release --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:android:release').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
Expand Down Expand Up @@ -146,13 +70,6 @@ jobs:
adb wait-for-device
adb shell input keyevent 82
./scripts/test-android.sh

# - name: Build example for Android
# env:
# JAVA_OPTS: '-XX:MaxHeapSize=6g'
# run: |
# yarn turbo run android --cache-dir="${{ env.TURBO_CACHE_DIR }}"

test-ios:
runs-on: macos-latest
env:
Expand All @@ -173,22 +90,6 @@ jobs:
cd example
bundle install

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
Expand All @@ -201,17 +102,12 @@ jobs:
${{ runner.os }}-cocoapods-

- name: Install cocoapods
# if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
bundle exec pod install
env:
NO_FLIPPER: 1

# - name: Build example for iOS
# run: |
# yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

- name: run tests
run: |
./scripts/test-ios.sh
Expand All @@ -236,22 +132,6 @@ jobs:
cd example
bundle install

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
Expand All @@ -264,7 +144,6 @@ jobs:
${{ runner.os }}-cocoapods-

- name: Install cocoapods
# if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
bundle exec pod install
Expand Down Expand Up @@ -295,22 +174,6 @@ jobs:
cd example
bundle install

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
Expand Down Expand Up @@ -353,22 +216,6 @@ jobs:
cd example
bundle install

- name: Cache turborepo for iOS
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-ios-

- name: Check turborepo cache for iOS
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:ios').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Cache cocoapods
if: env.turbo_cache_hit != 1
id: cocoapods-cache
Expand All @@ -381,7 +228,6 @@ jobs:
${{ runner.os }}-cocoapods-

- name: Install cocoapods
# if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example/ios
bundle exec pod install
Expand All @@ -407,22 +253,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:android:release --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:android:release').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
Expand Down Expand Up @@ -477,22 +307,6 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Cache turborepo for Android
uses: actions/cache@v4
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android-

- name: Check turborepo cache for Android
run: |
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run run:android:release --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'run:android:release').cache.status")

if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi

- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
Expand Down
35 changes: 35 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.{js,ts,jsx,tsx}"
# run: yarn eslint {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
# exclude: '(^|/)(application|routes)\.rb$'
# run: bundle exec rubocop --force-exclusion {all_files}
# govet:
# tags: backend style
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
# scripts:
# "hello.js":
# runner: node
# "any.go":
# runner: go run
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-builder-bob": "^0.23.2",
"turbo": "^1.12.4",
"typescript": "5.0.4"
},
"peerDependencies": {
"react": "*",
"react-native": ">0.73.0"
"react-native": "*"
},
"workspaces": [
"example"
Expand Down
40 changes: 0 additions & 40 deletions turbo.json

This file was deleted.

Loading
Loading