Skip to content

Commit

Permalink
feat: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Jan 21, 2022
1 parent 6a101c2 commit 2704155
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI
on:
push:

env:
SAUCE_USERNAME: shtylman-superagent
SAUCE_ACCESS_KEY: 39a45464-cb1d-4b8d-aa1f-83c7c04fa673

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- node-version: 12.x
# test-on-brower: 1
- node-version: 14.x
# test-http2: 1
- node-version: 16.x
# test-http2: 1
steps:
- uses: actions/checkout@v2

- name: Install Node - ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Build
run: npm run build
- name: Test On Node ${{ matrix.node-version }}
env:
BROWSER: ${{ matrix.test-on-brower }}
HTTP2_TEST: ${{ matrix.test-http2 }}
run: |
npm run test
npm run coverage
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test:
@if [ "x$(BROWSER)" = "x" ]; then make test-node; else make test-browser; fi

test-node:
@NODE_ENV=test ./node_modules/.bin/mocha \
@NODE_ENV=test nyc ./node_modules/.bin/mocha \
--require should \
--trace-warnings \
--throw-deprecation \
Expand Down

0 comments on commit 2704155

Please sign in to comment.