From e93aa9d5b3461c7cd8f2630fe0199ff8983aa064 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Tue, 18 Jul 2023 16:30:00 +0200 Subject: [PATCH] ci: add ci workflow (#17) --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 44 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..db52e43 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + - name: Install dependencies + run: npm install + - name: Lint files + run: npm run lint + test: + name: Test + strategy: + matrix: + os: [ubuntu-latest] + node: [20.x, 19.x, 18.x, 17.x, 16.x, 14.x, 12.x, "12.22.0"] + include: + - os: windows-latest + node: "lts/*" + - os: macOS-latest + node: "lts/*" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - name: Install dependencies + run: npm install + - name: Run tests + run: npm test diff --git a/package.json b/package.json index 27df689..3a5f7a5 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ ], "scripts": { "lint": "eslint .", - "test": "npm run lint && mocha ./tests/lib/**/*.js", + "test": "mocha ./tests/lib/**/*.js", "new-rule-format": "node ./bin/eslint-transforms.js -t ./lib/new-rule-format/new-rule-format.js", "generate-release": "eslint-generate-release", "generate-alpharelease": "eslint-generate-prerelease alpha",