Skip to content

Commit

Permalink
feat: change folders structure (#2319)
Browse files Browse the repository at this point in the history
# Summary
extract the shared example and use it in example and fabric-example, macos-example

## Test Plan

Run those apps manually.
  • Loading branch information
bohdanprog authored Jul 5, 2024
1 parent 9dc0247 commit 7c1602e
Show file tree
Hide file tree
Showing 344 changed files with 10,633 additions and 4,459 deletions.
10 changes: 5 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
**/node_modules/
Example/examples/
Example/android/
Example/ios/
Example/windows/
Example/macos/
example/examples/
example/android/
example/ios/
example/windows/
macos-example/macos/
screenshots/
android/
apple/
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/android-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- 'android/**'
- 'src/fabric/**'
- 'package.json'
- 'Example/android/**'
- 'Example/package.json'
- 'FabricExample/android/**'
- 'FabricExample/package.json'
- 'example/android/**'
- 'example/package.json'
- 'fabric-example/android/**'
- 'fabric-example/package.json'
push:
branches:
- main
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [Example, FabricExample]
working-directory: [example, fabric-example]
concurrency:
group: android-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ios-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ on:
- .github/workflows/ios-build-test.yml
- RNSVG.podspec
- apple/**
- Example/package.json
- Example/ios/**
- example/package.json
- example/ios/**
- src/fabric/**
- FabricExample/package.json
- FabricExample/ios/**
- fabric-example/package.json
- fabric-example/ios/**
- package.json
push:
branches:
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: macos-14
strategy:
matrix:
working-directory: [Example, FabricExample]
working-directory: [example, fabric-example]
fail-fast: false
concurrency:
group: ios-${{ matrix.working-directory }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ jobs:
- name: Test and lint
run: yarn test
- name: Build Example App
working-directory: Example/
working-directory: example/
run: yarn && yarn tsc
73 changes: 73 additions & 0 deletions .github/workflows/macos-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test macOS build
on:
pull_request:
paths:
- .github/workflows/macos-build-test.yml
- RNSVG.podspec
- apple/**
- macos-example/package.json
- macos-example/macos/**
- src/fabric/**
- package.json
push:
branches:
- main

jobs:
build:
if: github.repository == 'software-mansion/react-native-svg'
runs-on: macos-14
strategy:
matrix:
working-directory: [macos-example]
fail-fast: false
concurrency:
group: macos-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Restore react-native-svg node_modules from cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-node-modules-svg-

- name: Install react-native-svg node_modules
run: yarn install

- name: Restore app node_modules from cache
uses: actions/cache@v3
with:
path: ${{ matrix.working-directory }}/node_modules
key: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-

- name: Install app node_modules
working-directory: ${{ matrix.working-directory }}
run: yarn install

- name: Restore Pods from cache
uses: actions/cache@v3
with:
path: |
${{ matrix.working-directory }}/macos/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}

- name: Install Pods
working-directory: ${{ matrix.working-directory }}/macos
run: pod install

- name: Restore build artifacts from cache
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-macos-derived-data-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/macos/Podfile.lock', matrix.working-directory)) }}

- name: Build app
working-directory: ${{ matrix.working-directory }}
run: yarn macos
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We'd like to make contributions as pleasant as possible, so here's a small guide

### Testing your changes

Add test example in [TestsExample](https://github.com/react-native-svg/react-native-svg/tree/main/TestsExample) concerning your change following the convention of `TestX.tsx` where `X` is your PR number.
Add test example in [tests-example](https://github.com/react-native-svg/react-native-svg/tree/main/tests-example) concerning your change following the convention of `TestX.tsx` where `X` is your PR number.

## Tests

Expand Down
27 changes: 0 additions & 27 deletions Example/dist/index.html

This file was deleted.

14 changes: 0 additions & 14 deletions Example/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions Example/tsconfig.json

This file was deleted.

62 changes: 0 additions & 62 deletions Example/webpack.config.js

This file was deleted.

Loading

0 comments on commit 7c1602e

Please sign in to comment.