Skip to content

Commit

Permalink
Use orb and add tests to CI (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
flandrade authored Oct 21, 2020
1 parent c1478f4 commit 9557878
Showing 1 changed file with 18 additions and 41 deletions.
59 changes: 18 additions & 41 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,25 @@
version: 2.1
orbs:
node: 'circleci/[email protected]'

jobs:
build:
working_directory: ~/repo/react-native-sportlight-tour

machine:
docker_layer_caching: true
image: circleci/classic:latest

steps:
- checkout:
path: ~/repo/react-native-sportlight-tour

- run:
name: Setup NVM
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
source $BASH_ENV
executor:
name: node/default
tag: '14.7'

- run:
name: Install NodeJS
command: |
nvm install
nvm use
nvm alias default node
- run:
name: Install Yarn
command: |
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.4
echo 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"' >> $BASH_ENV
source $BASH_ENV
- restore_cache:
keys:
- v1-node-modules-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v1-node-modules-{{ .Branch }}-
- v1-node-modules-

- run:
name: Install dependencies
command: yarn install --frozen-lockfile
steps:
- checkout
- node/install:
node-version: '14.7.0'
install-npm: false
install-yarn: true
yarn-version: '1.22.4'

- save_cache:
key: v1-node-modules-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- node/install-packages:
pkg-manager: yarn

- run:
name: Lint
Expand All @@ -56,6 +29,10 @@ jobs:
name: Compile
command: yarn compile

- run:
name: Tests
command: yarn test

workflows:
build-and-check:
jobs:
Expand Down

0 comments on commit 9557878

Please sign in to comment.