Skip to content

Instantly share code, notes, and snippets.

@lundgrea
Last active October 28, 2019 21:21
Show Gist options
  • Save lundgrea/477c9880ee4ff13ceb4bd36e37c1a834 to your computer and use it in GitHub Desktop.
Save lundgrea/477c9880ee4ff13ceb4bd36e37c1a834 to your computer and use it in GitHub Desktop.
React Native + Expo + TravisCI w/Enzyme
$ npm ci
$ npx jest --ci

In the root of the repo: $ touch .travis.yml

$ npm install --save-dev expo-cli

In the .travis.yml file:

language: node_js
node_js:
  - node
  - lts/*
cache:
  directories:
    - ~/.npm
    - .jest
before_script:
  - npm install -g npm@latest
script:
  - npm ci
  - npx jest --ci
jobs:
  include:
    - stage: deploy
      node_js: lts/*
      script:
        - npm ci
        - npx expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD
        - npx expo publish --non-interactive

If you don't want to expose the password in the login script:

  1. Set the EXPO_CLI_PASSWORD environment variable to the password
  2. Run the following script: $ npx expo login --non-interactive -u

Visit TravisCI.org and click the + button next to “My Repositories” on the left pane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment