diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..760de88 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + name: Node.js ${{ matrix.node-version }} + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18, 20, 22] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Test + run: npm test diff --git a/README.md b/README.md index 3bb0bd6..c81ae9d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # filejson +[![CI](https://github.com/bchr02/filejson/actions/workflows/ci.yml/badge.svg)](https://github.com/bchr02/filejson/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/filejson.svg)](https://www.npmjs.com/package/filejson) [![npm downloads](https://img.shields.io/npm/dm/filejson.svg)](https://www.npmjs.com/package/filejson) [![Node.js Version](https://img.shields.io/node/v/filejson.svg)](https://nodejs.org)