diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e3bec4b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: src + strategy: + matrix: + node-version: [18] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + continue-on-error: true + + - name: Test + run: npm test diff --git a/src/package.json b/src/package.json index 4dc6176..56be352 100644 --- a/src/package.json +++ b/src/package.json @@ -7,7 +7,9 @@ "example": "examples" }, "scripts": { - "test": "mocha 'test/**/*.test.js'" + "test": "mocha 'test/**/*.test.js'", + "lint": "eslint .", + "lint": "eslint ." }, "repository": { "type": "git",