diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..f9e11a7 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,23 @@ +version: 2 # use CircleCI 2.0 +jobs: # a collection of steps + build: # runs not using Workflows must have a `build` job as entry point + docker: # run the steps with Docker + - image: circleci/openjdk:11-node # ...with this image as the primary container; this is where all `steps` will run + steps: # a collection of executable commands + - checkout # special step to check out source code to working directory + - run: + name: update-npm + command: 'sudo npm install -g npm@latest' + - restore_cache: # special step to restore the dependency cache + # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ + key: dependency-cache-{{ checksum "server/package.json" }} + - run: + name: install-npm + command: cd server && npm ci + - save_cache: # special step to save the dependency cache + key: dependency-cache-{{ checksum "server/package.json" }} + paths: + - ./server/node_modules + - run: # run tests + name: test + command: cd server && npm run ci diff --git a/.travis.yml b/.travis.yml index 673d727..d71f1ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,43 @@ -language: dart dist: xenial matrix: include: - - name: Test - env: COMMAND=test - - name: Analyze - env: COMMAND=analyze -addons: - apt: - packages: - - lib32stdc++6 -install: - - git clone https://github.com/flutter/flutter.git -b beta - - ./flutter/bin/flutter doctor -script: - - cd app - - ../flutter/bin/flutter $COMMAND + # - name: app test + # language: dart + # addons: + # apt: + # packages: + # - lib32stdc++6 + # install: + # - git clone https://github.com/flutter/flutter.git -b beta + # - ./flutter/bin/flutter doctor + # script: + # - cd app + # - ../flutter/bin/flutter test + # - name: app lint + # language: dart + # addons: + # apt: + # packages: + # - lib32stdc++6 + # install: + # - git clone https://github.com/flutter/flutter.git -b beta + # - ./flutter/bin/flutter doctor + # script: + # - cd app + # - ../flutter/bin/flutter analyze + - name: server test + language: node_js + node_js: "10" + before_install: + - java --version + install: + - cd server + - npm ci + script: + - npx firebase setup:emulators:firestore --debug + - npm run ci + cache: + # npm: true directories: - $HOME/.pub-cache diff --git a/server/package.json b/server/package.json index 47a4d61..f31799e 100644 --- a/server/package.json +++ b/server/package.json @@ -4,8 +4,8 @@ "description": "Instagram for birds", "main": "index.js", "scripts": { - "postinstall": "firebase setup:emulators:firestore", - "start-emulator": "firebase serve --only firestore > /dev/null", + "postinstall": "firebase setup:emulators:firestore --debug", + "start-emulator": "firebase serve --only firestore --debug", "pretest": "tsc", "test": "FIREBASE_FIRESTORE_EMULATOR_ADDRESS='127.0.0.1:8080' mocha", "posttest": "rm test/**/*.js test/**/*.map",