From aa281e78316d7710262f3038c95999676981d013 Mon Sep 17 00:00:00 2001 From: Jane Jeon Date: Mon, 25 Oct 2021 21:18:37 -0400 Subject: [PATCH] move to github actions for CI? --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..062195d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +# This workflow will do a clean install 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 + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + env: + CACHE_KEY: npm-cache-key-node-v${{ matrix.node-version }} + - run: npm i + - run: npm run lint + test: + needs: lint + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12, 14, 16] + # https://github.com/actions/setup-node#supported-version-syntax + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + env: + CACHE_KEY: npm-cache-key-node-v${{ matrix.node-version }} + - run: npm i + - run: npm test -- --ci --runInBand --reporters=default --reporters=jest-junit + env: + JEST_JUNIT_OUTPUT_NAME: results.xml + JEST_JUNIT_OUTPUT_DIR: reports/jest-node${{ matrix.node-version }}