Skip to content

Commit

Permalink
ci: improve workflows (#513)
Browse files Browse the repository at this point in the history
* ci: restructure setup
* ci: fix native workflows
* ci: add corepack enable to setup
* ci: align build naming
* ci: separate linting jobs
* ci: add expo builds
* chore: use plugin source in expo example
* ci: add setup-java to expo android build
* ci: remove unused label action
* ci: remove unused stale
* refactor: move pull_request_template.md
* ci: add dependabot for actions
* fix: lint ids
* ci: remove expo build
* ci: install brew before yarn
* ci: add plugin commands
* Revert "ci: install brew before yarn"
* ci: always clear detox cache
* ci: call detox through yarn
* docs: update badges
* chore: improve scripts
* ci: reorder tsc and eslint
  • Loading branch information
KiwiKilian authored Nov 26, 2024
1 parent 75ceccb commit 2ed0176
Show file tree
Hide file tree
Showing 15 changed files with 222 additions and 205 deletions.
File renamed without changes.
36 changes: 36 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Setup
description: Setup Node.js and install dependencies

inputs:
registry-url:
description: Optional registry to set up for auth.

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: ${{ inputs.registry-url }}

- name: Enable Corepack for yarn v4
run: corepack enable
shell: bash

- name: Cache dependencies
id: yarn-cache
uses: actions/cache@v4
with:
path: |
**/node_modules
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --immutable
shell: bash
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ updates:
interval: "weekly"
# Disable version updates for npm dependencies
open-pull-requests-limit: 0

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
16 changes: 0 additions & 16 deletions .github/label-actions.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/stale.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/android-actions.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/build-react-native-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build React Native Android

on:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./packages/react-native-app

steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Setup Azul Zulu OpenJDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

- name: Build Android
run: ./gradlew assemble
working-directory: packages/react-native-app/android
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: iOS Build & Detox
name: Build React Native iOS & Test with Detox

on:
workflow_call:
inputs:
NVMRC:
required: true
type: string

jobs:
build:
name: Build
runs-on: macos-latest
timeout-minutes: 45 # Figure out why this job can be super slow; runner hardware?
timeout-minutes: 30

defaults:
run:
Expand All @@ -20,16 +17,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node ${{ inputs.NVMRC }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.NVMRC }}

- name: Enable Corepack
run: corepack enable

- name: Install Yarn Dependencies
run: yarn install --immutable --check-cache
- name: Setup
uses: ./.github/actions/setup

- name: Install Pod Dependencies
run: cd ios && pod --version && pod install
Expand All @@ -38,9 +27,10 @@ jobs:
run: |
brew tap wix/brew
brew install applesimutils
yarn detox clean-framework-cache && yarn detox build-framework-cache
- name: Build for detox
- name: Build iOS
run: yarn detox build -c ios.sim.release

- name: Test with detox
- name: Test with Detox
run: yarn detox test --debug-synchronization 200 -c ios.sim.release
17 changes: 0 additions & 17 deletions .github/workflows/label-actions.yml

This file was deleted.

84 changes: 0 additions & 84 deletions .github/workflows/on-push.yml

This file was deleted.

Loading

0 comments on commit 2ed0176

Please sign in to comment.