From e5645f9cdc36a0d5fabbd0026e76ca8abc467ef5 Mon Sep 17 00:00:00 2001 From: Luke Peavey <1williampeavey@gmail.com> Date: Sun, 26 Jun 2022 02:58:13 -0400 Subject: [PATCH] chore: setup github actions Planning to move from CircleCI to GitHub actions --- .circleci/config.yml | 40 ------------------------------------- .github/workflows/tests.yml | 32 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 40 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/tests.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 62b4b6f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: 2.1 -workflows: - integration_tests: - jobs: - - test - -jobs: - test: - docker: - - image: circleci/node:13 - - image: circleci/mongo:4.2.2 - - working_directory: ~/quotable - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "package.json" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - name: Installing dependencies - command: npm install - - - save_cache: - paths: - - node_modules - key: v1-dependencies-{{ checksum "package.json" }} - - - run: - name: Running ESLint - command: npm run lint - - - run: - name: Running tests - command: npm run test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1479765 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean installation of node dependencies, cache/ +# restore them, build the source code and run tests across different versions +# of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: CI Tests +env: + MONGODB_URI: ${{ secrets.MONGODB_URI }} +on: + push: + branches: ['master'] + pull_request: + branches: ['master'] +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build --if-present + - run: npm test