From af63068c50b802aa2f361708b419e5c20f1b0521 Mon Sep 17 00:00:00 2001 From: Rodion Abdurakhimov Date: Fri, 18 Dec 2020 00:57:23 +0200 Subject: [PATCH] Setup CI --- .github/workflows/ci.yaml | 43 +++++++++++++++++++++++++++++++++++++++ package.json | 5 ++++- 2 files changed, 47 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..5144fb4 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,43 @@ +name: Node.js CI + +on: + schedule: + - cron: '23 4 * * *' # Once, nightly + push: + branches: + - main + pull_request: + +jobs: + + test: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 15, 14, 12, 10 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run tests-only + + lint: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 14 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run lint diff --git a/package.json b/package.json index 0758fff..1542738 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,10 @@ "create-package": "bin/create-package" }, "scripts": { - "test": "standard && mocha --timeout=60000", + "lint": "standard", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "mocha --timeout=60000", "test:debug": "mocha --inspect --inspect-brk --timeout=0", "release": "npm t && standard-version && npm publish", "postpublish": "git push origin && git push origin --tags"