-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add github workflow to test every template (#276)
- Loading branch information
Showing
6 changed files
with
136 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Build all templates | ||
on: | ||
push: | ||
|
||
jobs: | ||
build-templates: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
type: | ||
- module | ||
- view | ||
language: | ||
- java-objc | ||
- java-swift | ||
- kotlin-objc | ||
- kotlin-swift | ||
- cpp | ||
example: | ||
- native | ||
include: | ||
- type: module | ||
language: js | ||
example: expo | ||
- type: module | ||
language: js | ||
example: native | ||
- type: module-legacy | ||
language: java-objc | ||
example: native | ||
- type: module-turbo | ||
language: java-objc | ||
example: native | ||
- type: module-mixed | ||
language: java-objc | ||
example: native | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16.x | ||
cache: yarn | ||
|
||
- name: Restore project yarn cache | ||
id: root-yarn-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.root-yarn-cache.outputs.cache-hit != 'true' | ||
run: | | ||
yarn install --frozen-lockfile | ||
- name: Build package | ||
run: | | ||
yarn workspace create-react-native-library prepare | ||
- name: Create temporary working directory | ||
run: | | ||
mkdir ../tmp | ||
- name: Create library | ||
working-directory: ../tmp | ||
run: | | ||
../react-native-builder-bob/packages/create-react-native-library/bin/create-react-native-library react-native-test \ | ||
--slug react-native-test \ | ||
--description test \ | ||
--author-name test \ | ||
--author-email test@test \ | ||
--author-url https://test.test \ | ||
--repo-url https://test.test \ | ||
--type ${{ matrix.type }} \ | ||
--languages ${{ matrix.language }} \ | ||
--example ${{ matrix.example }} | ||
- name: Cache dependencies of library | ||
id: library-yarn-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
../tmp/react-native-test/node_modules | ||
../tmp/example/node_modules | ||
key: ${{ runner.os }}-library-yarn-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.example}}-${{ hashFiles('yarn.lock') }} | ||
|
||
- name: Install dependencies of library | ||
if: steps.library-yarn-cache.outputs.cache-hit != 'true' | ||
working-directory: ../tmp/react-native-test | ||
run: | | ||
yarn install | ||
- name: Lint library | ||
working-directory: ../tmp/react-native-test | ||
run: | | ||
yarn lint | ||
- name: Typecheck library | ||
working-directory: ../tmp/react-native-test | ||
run: | | ||
yarn typescript | ||
- name: Test library | ||
working-directory: ../tmp/react-native-test | ||
run: | | ||
yarn test |
26 changes: 12 additions & 14 deletions
26
.github/workflows/test-monorepo.yml → .github/workflows/check-project.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
name: Test monorepo | ||
name: Check project | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
|
||
jobs: | ||
test-monorepo: | ||
name: Test monorepo | ||
check-project: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install node | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.13.x | ||
node-version: 16.x | ||
cache: yarn | ||
|
||
- name: Restore dependencies | ||
- name: Restore yarn cache | ||
id: yarn-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: '**/node_modules' | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Lint files | ||
- name: Lint | ||
run: yarn lint | ||
|
||
- name: Build packages in the monorepo | ||
- name: Build packages | ||
run: yarn lerna run prepare | ||
|
||
- name: Typecheck files | ||
- name: Typecheck | ||
run: yarn typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/create-react-native-library/templates/example/example/react-native.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/create-react-native-library/templates/native-library-turbo/src/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters