diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index fbef3f077..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,135 +0,0 @@ -# Based off the script from the react-native-firebase project. Licenced under the Apache 2.0 licence -# Details: https://github.com/invertase/react-native-firebase - -# ------------------------- -# ALIASES -# ------------------------- - -aliases: - # ------------------------- - # CACHE - # ------------------------- - - &restore-yarn-cache - keys: - - yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} - - yarn-cache-{{ arch }} - - - &save-yarn-cache - paths: - - ~/.cache/yarn - - ~/Library/Detox/ios - key: yarn-cache-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} - - # ------------------------- - # INSTALLATION - # ------------------------- - - &yarn - name: Yarn Install - command: | - yarn install --network-concurrency 1 --non-interactive --cache-folder ~/.cache/yarn & wait - - # ------------------------- - # ANALYSE - # ------------------------- - - - &flow - name: Flow Checks - command: yarn test:flow - - - &javascript - name: Javascript Tests - command: yarn test:js - - - &eslint - name: Lint - command: yarn lint - - - &tsc - name: TypeScript type check - command: yarn test:tsc - -# ------------------------- -# DEFAULTS -# ------------------------- -defaults: &defaults - working_directory: ~/push-notification-ios - environment: - - GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1 - -# JAVASCRIPT -js_defaults: &js_defaults - <<: *defaults - docker: - - image: circleci/node:10 - environment: - - PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" - -# ------------------------- -# JOBS -# ------------------------- - -version: 2 -jobs: - # Set up a Node environment for downstream jobs - checkout-code: - <<: *js_defaults - steps: - - checkout - - restore-cache: *restore-yarn-cache - - run: rm -rf node_modules - - run: yarn cache clean - - run: *yarn - - save-cache: *save-yarn-cache - - persist_to_workspace: - root: . - paths: . - - flow: - <<: *js_defaults - steps: - - attach_workspace: - at: ~/push-notification-ios - - run: *flow - - javascript: - <<: *js_defaults - steps: - - attach_workspace: - at: ~/push-notification-ios - - run: *javascript - - lint: - <<: *js_defaults - steps: - - attach_workspace: - at: ~/push-notification-ios - - run: *eslint - - tsc: - <<: *js_defaults - steps: - - attach_workspace: - at: ~/push-notification-ios - - run: *tsc - - -# ------------------------- -# WORK FLOWS -# ------------------------- -workflows: - version: 2 - Test: - jobs: - - checkout-code - - flow: - requires: - - checkout-code - - javascript: - requires: - - checkout-code - - lint: - requires: - - checkout-code - - tsc: - requires: - - checkout-code diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..bee3f8a4b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,91 @@ +name: Build +on: push + +jobs: + lint: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10,12,14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: ESLint Checks + run: yarn lint + tsc: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10,12,14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: TypeScript type check + run: yarn test:tsc + flow: + runs-on: ubuntu-18.04 + strategy: + matrix: + node-version: [10,12,14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: TypeScript type check + run: yarn test:flow + ios: + runs-on: macos-latest + strategy: + matrix: + node-version: [10,12,14] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + - name: Install Dependencies + run: yarn + - name: Install Podfiles + run: cd example && npx pod-install + - name: Build example app + run: yarn ios +