Skip to content

Commit 042082c

Browse files
chore: optimize CI jobs (#78)
1 parent 36a0c1c commit 042082c

File tree

5 files changed

+200
-0
lines changed

5 files changed

+200
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: React Native - RN CLI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['examples/native-cli/**']
7+
pull_request:
8+
branches: ['**']
9+
paths: ['examples/native-cli/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
14+
15+
jobs:
16+
validate:
17+
name: Validate
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20.x
30+
cache: 'yarn'
31+
32+
- name: Install Example
33+
run: yarn --cwd examples/native-cli install
34+
35+
- name: Validate TypeScript
36+
run: yarn --cwd examples/native-cli typecheck
37+
38+
- name: Validate ESLint
39+
run: yarn --cwd examples/native-cli lint
40+
41+
- name: Run tests
42+
run: yarn --cwd examples/native-cli test
43+
44+
- name: Run perf tests
45+
run: cd examples/native-cli && ./reassure-tests.sh
46+
47+
- name: Run Danger.js
48+
run: yarn --cwd examples/native-cli danger ci --id native
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: React Native - Expo
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['examples/native-expo/**']
7+
pull_request:
8+
branches: ['**']
9+
paths: ['examples/native-expo/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
14+
15+
jobs:
16+
validate:
17+
name: Validate
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20.x
30+
cache: 'yarn'
31+
32+
- name: Install Example
33+
run: yarn --cwd examples/native-expo install
34+
35+
- name: Validate TypeScript
36+
run: yarn --cwd examples/native-expo typecheck
37+
38+
- name: Run tests
39+
run: yarn --cwd examples/native-expo test
40+
41+
- name: Run perf tests
42+
run: cd examples/native-expo && ./reassure-tests.sh
43+
44+
- name: Run Danger.js
45+
run: yarn --cwd examples/native-expo danger ci --id native-expo
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Web - Next.js
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['examples/web-nextjs/**']
7+
pull_request:
8+
branches: ['**']
9+
paths: ['examples/web-nextjs/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
14+
15+
jobs:
16+
validate:
17+
name: Validate
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20.x
30+
cache: 'yarn'
31+
32+
- name: Install Example
33+
run: yarn --cwd examples/web-nextjs install
34+
35+
- name: Validate ESLint
36+
run: yarn --cwd examples/web-nextjs lint
37+
38+
- name: Run tests
39+
run: yarn --cwd examples/web-nextjs test
40+
41+
- name: Run perf tests
42+
run: cd examples/web-nextjs && ./reassure-tests.sh
43+
44+
- name: Run Danger.js
45+
run: yarn --cwd examples/web-nextjs danger ci --id web-nextjs
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-web-vite.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Web - Vite
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['examples/web-vite/**']
7+
pull_request:
8+
branches: ['**']
9+
paths: ['examples/web-vite/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
14+
15+
jobs:
16+
validate:
17+
name: Validate
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Enable Corepack
24+
run: corepack enable
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20.x
30+
cache: 'yarn'
31+
32+
- name: Install Example
33+
run: yarn --cwd examples/web-vite install
34+
35+
- name: Validate TypeScript
36+
run: yarn --cwd examples/web-vite typecheck
37+
38+
- name: Validate ESLint
39+
run: yarn --cwd examples/web-vite lint
40+
41+
- name: Run tests
42+
run: yarn --cwd examples/web-vite test
43+
44+
- name: Run perf tests
45+
run: cd examples/web-vite && ./reassure-tests.sh
46+
47+
- name: Run Danger.js
48+
run: yarn --cwd examples/web-vite danger ci --id web-vite
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-example-apps.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ name: Examples
33
on:
44
push:
55
branches: [main]
6+
paths: ['examples/xxx/**']
67
pull_request:
78
branches: ['**']
9+
paths: ['examples/xxx/**']
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ !contains(github.ref, 'main')}}
814

915
jobs:
1016
test-native:

0 commit comments

Comments
 (0)