From ed73d70fd04a25e32244b73a60cb8102b7539999 Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Wed, 27 Mar 2024 15:45:03 -0700 Subject: [PATCH] Clean up GitHub Actions workflow (#153) --- .github/workflows/ci.yml | 50 +++++++++++++++------------------------- package.json | 3 ++- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85e293c..27a9bea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ -name: CI +name: ci -on: [push, pull_request] +on: + push: + branches: + - master + pull_request: permissions: contents: read @@ -15,14 +19,13 @@ jobs: persist-credentials: false - uses: actions/setup-node@v4 with: - node-version: 18 - cache: yarn - - run: yarn install # --frozen-lockfile TODO get this option working - - run: yarn lint - test-js: + node-version: 20 + - run: npm install + - run: npm run lint + + test: timeout-minutes: 2 runs-on: ubuntu-latest - needs: lint strategy: fail-fast: false matrix: @@ -32,38 +35,21 @@ jobs: - '16' - '18' - '20' - name: test js - node v${{ matrix.node }} steps: - uses: actions/checkout@v4 - with: - persist-credentials: false - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - cache: yarn - - run: yarn install # --frozen-lockfile TODO get this option working - - run: yarn test - test-ts: + - run: npm install + - run: npm test + + types: timeout-minutes: 2 runs-on: ubuntu-latest - needs: lint - strategy: - fail-fast: false - matrix: - node: - - '12' - - '14' - - '16' - - '18' - - '20' - name: test ts - node v${{ matrix.node }} steps: - uses: actions/checkout@v4 - with: - persist-credentials: false - uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node }} - cache: yarn - - run: yarn install # --frozen-lockfile TODO get this option working - - run: yarn test-ts + node-version: '20' + - run: npm install + - run: npm run test-ts diff --git a/package.json b/package.json index 4df9acc..570f6e0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "coverage": "nyc --reporter=html npm test && open-cli coverage/index.html", "coverage-ci": "nyc --reporter=lcov npm test && codecov", "lint": "standard", - "test": "tape test/*.js | tap-spec && npm run test-ts && npm run lint", + "test": "npm run test-js && npm run test-ts && npm run lint", + "test-js": "tape test/*.js | tap-spec", "test-ts": "tsd" }, "repository": {