From f7e2542f501b01762c51a7778f8674290375e515 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 11 Feb 2020 15:51:18 -0800 Subject: [PATCH 1/3] build: add GitHub actions config for unit tests --- .github/workflows/ci.yaml | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) 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 From c06457f2496f55edda1d5d98906e8fd6411b05a0 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 11 Feb 2020 18:10:37 -0800 Subject: [PATCH 2/3] chore: link root directory before linting --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d562540..1b715ae 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,7 @@ "system-test": "mocha build/system-test", "presystem-test": "npm run compile", "docs-test": "linkinator docs", - "predocs-test": "npm run docs" + "predocs-test": "npm run docs", + "prelint": "cd samples; npm link ../" } } From c65b715087a1c351da15dd8a3e101759eb395025 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Tue, 11 Feb 2020 18:22:14 -0800 Subject: [PATCH 3/3] chore: also need to npm i --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1b715ae..b35d54d 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,6 @@ "presystem-test": "npm run compile", "docs-test": "linkinator docs", "predocs-test": "npm run docs", - "prelint": "cd samples; npm link ../" + "prelint": "cd samples; npm link ../; npm i" } }