From a86846c1e3539db214b01fbbeb21b45d0ee850be Mon Sep 17 00:00:00 2001 From: Jonathan Golden Date: Wed, 11 Nov 2020 09:42:08 -0700 Subject: [PATCH] chore(workflows): configure tests workflow This adds a workflow to run test cases against pull requests to the main and support branches. --- .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9e4ce71 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests +on: + pull_request: + branches: + - main + - support/** +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + node: [ '10.x', '12.x' ] + name: Node ${{ matrix.node }} + steps: + - uses: actions/checkout@v2 + - run: | + git remote set-branches --add origin main + git fetch + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - name: Install Dependencies + run: npm ci + env: + NODE_ENV: development + - name: Unit Tests + run: npm run test + env: + NODE_ENV: production diff --git a/package.json b/package.json index b49e85f..af013e6 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "build/index.js", "scripts": { "lint": "eslint ./ --ignore-path .gitignore --ext .js", - "test": "jest --ci=false", + "test": "jest", "test:lockfile": "lockfile-lint -p package-lock.json -t npm -a npm -o https: -c -i", "test:git-history": "commitlint --from origin/main --to HEAD", "build": "babel src --out-dir build",