From 133b447bb895538c645c75dd3809a92b6d7ba929 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 13 Feb 2020 07:26:09 -0800 Subject: [PATCH] build: add GitHub actions config for unit tests * build: add GitHub actions config for unit tests * chore: link root directory before linting * chore: also need to npm i --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..4d36c57 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,57 @@ +on: + push: + branches: + - master + pull_request: +name: ci +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [8, 10, 12, 13] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: node --version + - run: npm install + - run: npm test + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run lint + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm run docs-test + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm install + - run: npm test + - run: ./node_modules/.bin/c8 report --reporter=text-lcov | npx codecov@3 -t ${{ secrets.CODECOV_TOKEN }} --pipe diff --git a/package.json b/package.json index 9850c92..ce225f4 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "docs": "compodoc src/", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../" + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "prelint": "cd samples; npm link ../; npm i" }, "repository": "JustinBeckwith/gaxios", "keywords": [