From 7e5c940ac08235c214101c8806123c6d70bf62cb Mon Sep 17 00:00:00 2001 From: Andrew Chou Date: Wed, 22 Jan 2025 14:39:10 -0500 Subject: [PATCH] chore: introduce workflow for running tests (#37) * add ci workflow * update test:prettier script * only run on ubuntu --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4c25d01 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + node-version: [18.x, 20.x, 22.x] + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test diff --git a/package.json b/package.json index 8f0a6a5..f2468ff 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "prepare": "husky install", "format": "prettier --write .", "test:eslint": "eslint . --cache", - "test:prettier": "prettier --check **/*.js", + "test:prettier": "prettier --cache --check **/*.js", "test:typescript": "npm run type", "test:node": "node --test", "test": "npm-run-all --aggregate-output --print-label --parallel test:*",