Skip to content

Commit

Permalink
Merge pull request #1677 from yunnysunny/feature/github-action2
Browse files Browse the repository at this point in the history
feat: add github action
  • Loading branch information
titanism committed Mar 29, 2022
2 parents 84206c7 + 2704155 commit 451cdcd
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
@@ -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
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 451cdcd

Please sign in to comment.