From 8ca6ae1d1b455ab6e0e20397ec18400062d33c70 Mon Sep 17 00:00:00 2001 From: Demian Parkhomenko <95881717+DemianParkhomenko@users.noreply.github.com> Date: Fri, 8 Sep 2023 01:12:33 +0300 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ package.json | 6 +++++- 2 files changed, 29 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..73d3f8e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: '20.x' + - run: npm ci + - run: npm run format:check + - run: npm run lint:check + - run: npm run test diff --git a/package.json b/package.json index d4016aa..480ca1b 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,11 @@ "main": "index.js", "scripts": { "start": "node index.js", - "test": "echo \": no test specified\"", + "test": "echo no test specified", + "lint:check": "eslint .", + "lint:write": "eslint --fix .", + "format:check": "prettier --check .", + "format:write": "prettier --write .", "prepare": "husky install" }, "lint-staged": {