Skip to content

Commit 1411fbf

Browse files
authored
improve ci workflow (#42)
* improve ci workflow Signed-off-by: gengjiawen <[email protected]> * fix typo Signed-off-by: gengjiawen <[email protected]>
1 parent 44a9b0d commit 1411fbf

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

.circleci/config.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
version: 2
2+
3+
defaults: &defaults
4+
machine: true
5+
working_directory: ~/project
6+
7+
aliases:
8+
- &build-docker
9+
name: Install curl
10+
command: |
11+
docker build -t react-native-community/react-native .
12+
docker run --rm --name rn-env react-native-community/react-native bin/sh -c "npx envinfo"
13+
214
jobs:
3-
build:
4-
machine: true
5-
working_directory: ~/project
6-
steps:
7-
- checkout
8-
- run:
9-
name: Build docker image
10-
command: |
11-
docker build -t react-native-community/react-native .
12-
- run:
13-
name: Docker info
14-
command: |
15-
docker run --rm --name rn-env react-native-community/react-native bin/sh -c "npx envinfo"
1615
test:
17-
machine: true
16+
<<: *defaults
1817
steps:
18+
- checkout
19+
- run: *build-docker
1920
- run:
2021
name: Test
2122
command: |
@@ -24,8 +25,10 @@ jobs:
2425
docker run --rm --name rn-build -v $PWD:/pwd -w /pwd react-native-community/react-native /bin/sh -c \
2526
"yarn install && ./gradlew RNTester:android:app:assembleRelease && ./scripts/circleci/buck_fetch.sh"
2627
deploy:
27-
machine: true
28+
<<: *defaults
2829
steps:
30+
- checkout
31+
- run: *build-docker
2932
- run:
3033
name: Deploy docker
3134
command: |
@@ -37,13 +40,8 @@ workflows:
3740
version: 2
3841
main:
3942
jobs:
40-
- build
41-
- test:
42-
requires:
43-
- build
43+
- test
4444
- deploy:
45-
requires:
46-
- build
4745
filters:
4846
branches:
4947
only: master

0 commit comments

Comments
 (0)