1+ # Javascript Node CircleCI 2.0 configuration file
2+ #
3+ # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4+ #
15version : 2
2-
3- default_config : &default_config
4- working_directory : ~/circleci/SP-NativeScript
5- macos :
6- xcode : " 9.3.0"
7- environment :
8- ANDROID_HOME : " /usr/local/share/android-sdk"
9-
106jobs :
117 build :
12- << : *default_config
8+ docker :
9+ # specify the version you desire here
10+ - image : circleci/node:10.15.0
11+
12+ # Specify service dependencies here if necessary
13+ # CircleCI maintains a library of pre-built images
14+ # documented at https://circleci.com/docs/2.0/circleci-images/
15+ # - image: circleci/mongo:3.4.4
16+
17+ working_directory : ~/repo
18+
1319 steps :
1420 - checkout
15- - add_ssh_keys
16- - run :
17- name : Fetch CocoaPods repository
18- command : |
19- curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
20- # Fetch cocoapods specs from S3 instead of github
21- - run :
22- name : Setup system dependencies
23- command : |
24- brew update
25- brew cask install android-sdk
26- echo y | $ANDROID_HOME/tools/bin/sdkmanager "platform-tools" "platforms;android-25" "build-tools;25.0.2" "extras;android;m2repository" "extras;google;m2repository"
27- - restore_cache :
28- key : npm-cache-{{ checksum "./package-lock.json" }}
29- - run :
30- name : " Install node dependencies"
31- command : |
32- npm install
33- npx tns usage-reporting disable
34- npx tns error-reporting disable
35- - save_cache :
36- key : npm-cache-{{ checksum "./package-lock.json" }}
37- paths :
38- - ~/.npm
39- - run :
40- name : " Rebuild Node SASS bindings"
41- command : npm rebuild node-sass --force
42- - run :
43- name : " Pre-launch iOS Simulator"
44- command : xcrun instruments -w "iPhone 8 (11.2) [" || true
45- - run :
46- name : " Prepare ios"
47- # Hack -> git log outputed as error
48- command : npx tns prepare ios || echo "ios build done"
49- - run :
50- name : " Prepare Android"
51- command : npx tns prepare android
52- - run :
53- name : " Build iOS"
54- command : |
55- ./scripts/build_ios.sh org.nativescript.circleciint
56- - run :
57- name : " Build Android"
58- command : |
59- ./scripts/build_android.sh
60- - persist_to_workspace :
61- root : ~/circleci
62- paths :
63- - tns-circleci-example
6421
65- test-unit :
66- << : *default_config
67- steps :
68- - attach_workspace :
69- at : ~/circleci
70- - run :
71- name : " Run unit tests"
72- # --justlaunch ensure the unit test suite give the hand back to the CLI in the end
73- command : |
74- npx tns usage-reporting disable
75- npx tns error-reporting disable
76- npx tns test ios --justlaunch
22+ # Download and cache dependencies
23+ - restore_cache :
24+ keys :
25+ - v1-dependencies-{{ checksum "package.json" }}
26+ # fallback to using the latest cache if no exact match is found
27+ - v1-dependencies-
7728
78- test-e2e :
79- << : *default_config
80- steps :
81- - attach_workspace :
82- at : ~/circleci
83- - run :
84- name : " Run E2E tests"
85- command : |
86- npx tns usage-reporting disable
87- npx tns error-reporting disable
88- echo "TODO"
29+ - run : sudo npm install -g nativescript
30+ - run : npm install
8931
90- deploy :
91- << : *default_config
92- steps :
93- - attach_workspace :
94- at : ~/circleci
95- - run :
96- name : " Deploy"
97- command : |
98- npx tns usage-reporting disable
99- npx tns error-reporting disable
100- ./scripts/deploy.sh
32+ - save_cache :
33+ paths :
34+ - node_modules
35+ key : v1-dependencies-{{ checksum "package.json" }}
10136
102- workflows :
103- version : 2
104- build-test-and-deploy :
105- jobs :
106- - build
107- - test-unit :
108- requires :
109- - build
110- - test-e2e :
111- requires :
112- - build
113- - deploy :
114- requires :
115- - build
116- - test-unit
117- - test-e2e
37+ # run tests!
38+ - run : tns test ios
0 commit comments