From 3aacd454036ca1aed57bfe8cb56d1ceab3746f2f Mon Sep 17 00:00:00 2001 From: "Andrew W. Hill" Date: Tue, 14 Apr 2020 12:10:12 -0700 Subject: [PATCH] feat(checks): adds spelling, commit lint, notary * feat(ci): uses release notary * fix(tests): stream timeout needed a longer wait --- .github/workflows/publish.yml | 10 ++-- .github/workflows/review.yml | 52 +++++++++++++++++++ .github/workflows/{lint_test.yml => test.yml} | 33 +----------- package.json | 1 - src/index.spec.ts | 2 +- 5 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/review.yml rename .github/workflows/{lint_test.yml => test.yml} (59%) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 15f5092..2441bd8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,9 @@ name: publish on: - release: - types: [published] + push: + tags: + - "v*" jobs: - publish: name: publish runs-on: ubuntu-latest @@ -35,3 +35,7 @@ jobs: run: | json -I -f package.json -e 'this.version=("${{ steps.latesttag.outputs.tag }}").replace("v", "")' npm publish --access=public + - name: Release Notary Action + uses: commitsar-app/release-notary@v0.7.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml new file mode 100644 index 0000000..ac39617 --- /dev/null +++ b/.github/workflows/review.yml @@ -0,0 +1,52 @@ +name: Review +on: [pull_request] +jobs: + eslint: + name: eslint + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'skip-ci')" + + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Cache + uses: actions/cache@v1 + with: + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Setup + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install + run: npm install + + - name: Lint + run: npm run lint + + spell-check: + name: spell-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: reviewdog/action-misspell@v1 + with: + reporter: github-pr-review + github_token: ${{ secrets.github_token }} + locale: "US" + + validate-commits: + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Run Commitsar + uses: docker://outillage/commitsar + diff --git a/.github/workflows/lint_test.yml b/.github/workflows/test.yml similarity index 59% rename from .github/workflows/lint_test.yml rename to .github/workflows/test.yml index 52794a5..080805a 100644 --- a/.github/workflows/lint_test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: lint_test +name: Tests on: push: branches: @@ -8,37 +8,8 @@ on: - master jobs: - lint: - name: Lint - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, 'skip-ci')" - - steps: - - name: Checkout - uses: actions/checkout@v1 - - - name: Cache - uses: actions/cache@v1 - with: - path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: Setup - uses: actions/setup-node@v1 - with: - node-version: 12 - - - name: Install - run: npm install - - - name: Lint - run: npm run lint - test: - name: Test + name: test runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, 'skip-ci')" diff --git a/package.json b/package.json index 17362c6..afd69d1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "test": "npm run test:node && npm run test:browser", "lint": "eslint --fix --ext .mjs,.js,.jsx,.ts,.tsx src", "docs": "typedoc && touch ./docs/.nojekyll", - "precommit": "npm run lint && npm test", "preversion": "npm run docs; npm run precommit", "release": "npm version patch", "postversion": "git push --follow-tags", diff --git a/src/index.spec.ts b/src/index.spec.ts index aea4922..386382c 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -290,7 +290,7 @@ describe('Client', function () { client.save(dbID, 'Person', [person]) person.age = 40 client.save(dbID, 'Person', [person]) - }).timeout(5000) // Make sure our test doesn't timeout + }).timeout(15000) // Make sure our test doesn't timeout }) describe('Query', () => { before(async () => {