From 836a033f8f00bb64be8f41f378ed9f5cf47d780e Mon Sep 17 00:00:00 2001 From: 3y3 <3y3@ya.ru> Date: Sun, 11 Aug 2024 01:38:34 +0300 Subject: [PATCH] chore: Add tests --- .github/workflows/tests.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- test/package.json | 10 ++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests.yml create mode 100644 test/package.json diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..cb65815 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,32 @@ +name: Tests + +on: + push: + branches: [master] + pull_request: + branches: ['**'] + +jobs: + test: + name: Node v${{ matrix.node-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + node-version: [18.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + os: ${{ matrix.os }} + cache: 'npm' + - name: Install packages for project + run: npm ci + - name: Run tests + run: | + cd test + npm start diff --git a/package.json b/package.json index 99c6580..3cf5a28 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "lint": "./bin/lint" }, "scripts": { - "test": "exit 0" + "test": "cd test && npm start" }, "exports": { "./eslint-config": "./eslint-common-config.js", diff --git a/test/package.json b/test/package.json new file mode 100644 index 0000000..d859d2b --- /dev/null +++ b/test/package.json @@ -0,0 +1,10 @@ +{ + "name": "test", + "private": true, + "workspaces": [ + "../" + ], + "scripts": { + "start": "npm i @diplodoc/lint && npx @diplodoc/lint install" + } +} \ No newline at end of file