Skip to content

Commit 3bad82d

Browse files
committed
refactor: use GitHub actions instead of CircleCI for generated project
This adds config for GitHub actions and removes the CircleCI config from the generated project. Previously, we kept CircleCI config as it provided better caching and was more optimized due to multiple jobs being able to reuse the result from the one job, reducing the setup time. While the problems with setup time still remains with GitHub actions, the caching part is better now which allows us to skip installing dependencies - reducing those concerns. The biggest advantage of GitHub actions is that since it's integrated with GitHub, the CI doesn't require additional steps after creating a project. In addition, we've moved to GitHub actions for this monorepo already, so it's easier for us to maintain the config for GitHub actions as opposed a CircleCI config that we don't use.
1 parent 01b9b29 commit 3bad82d

File tree

3 files changed

+70
-98
lines changed

3 files changed

+70
-98
lines changed

packages/create-react-native-library/templates/common/$.circleci/config.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version: 16.x
11+
12+
- name: Restore yarn cache
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: |
17+
'**/node_modules'
18+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
19+
restore-keys: |
20+
${{ runner.os }}-yarn-
21+
22+
- name: Install dependencies
23+
if: steps.yarn-cache.outputs.cache-hit != 'true'
24+
run: |
25+
yarn install --cwd example --frozen-lockfile
26+
yarn install --frozen-lockfile
27+
shell: bash
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
on:
3+
push:
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v3
11+
12+
- name: Setup
13+
uses: ./.github/actions/setup
14+
15+
- name: Lint files
16+
run: yarn lint
17+
18+
- name: Typecheck files
19+
run: yarn typescript
20+
21+
test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Setup
28+
uses: ./.github/actions/setup
29+
30+
- name: Run unit tests
31+
run: yarn test --maxWorkers=2 --coverage
32+
33+
build:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
39+
- name: Setup
40+
uses: ./.github/actions/setup
41+
42+
- name: Build package
43+
run: yarn prepare

0 commit comments

Comments
 (0)