Skip to content

TEST CI #2

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
82 changes: 82 additions & 0 deletions .github/workflows/test-all-templates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test all templates
on:
pull_request:
branches:
- main

jobs:
test-all-templates:
name: Test all templates
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
type: [module, view]
language: [java-objc, java-swift, kotlin-objc, kotlin-swift, cpp, js]
example: [native]
include:
- type: module
language: js
example: expo
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 16.13.x
cache: yarn

- name: Restore root level yarn cache
id: root-yarn-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-root-yarn-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.root-yarn-cache.outputs.cache-hit != 'true'
working-directory: ./packages/create-react-native-library
run: |
yarn install --frozen-lockfile

- name: Build package
working-directory: ./packages/create-react-native-library
run: |
yarn prepare

- name: Create example app
working-directory: ./packages/create-react-native-library/bin
run: |
./create-react-native-library test --slug test --description test --author-name test --author-email test@test --author-url https:// --repo-url https:// --type ${{ matrix.type }} --languages ${{ matrix.language }} --example ${{ matrix.example }}

- name: Restore dependencies of example app
id: example-app-yarn-cache
uses: actions/cache@v3
with:
path: |
packages/create-react-native-library/bin/test/node_modules
packages/create-react-native-library/bin/test/example/node_modules
key: ${{ runner.os }}-example-app-yarn-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.example}}-${{ hashFiles('yarn.lock') }}

- name: Install dependencies of example app
if: steps.example-app-yarn-cache.outputs.cache-hit != 'true'
working-directory: ./packages/create-react-native-library/bin/test
run: |
yarn install

- name: Lint example app
working-directory: ./packages/create-react-native-library/bin/test
run: |
yarn lint

- name: Generate types of example app
working-directory: ./packages/create-react-native-library/bin/test
run: |
yarn typescript

- name: Run tests on example app
working-directory: ./packages/create-react-native-library/bin/test
run: |
yarn test