From 7da52086df87de8f747219a0c9620e2493d0cc96 Mon Sep 17 00:00:00 2001 From: mr150 Date: Mon, 10 Jun 2024 19:01:40 +0300 Subject: [PATCH] ci: add an action for tests --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..52dbeb04 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + pull_request: + paths: + - 'packages' + - 'test' + - '.github/workflows/test.yml' + +jobs: + test: + name: Check that packages compiles, lint and tests pass + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build:packages + - name: Lint + run: npm run lint + - name: Test + run: npm test diff --git a/package.json b/package.json index cc86cca6..018feda1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ ], "scripts": { "dev": "npx gulp -f gulpfile.cjs", - "build:all": "export NODE_ENV=production && npm run build --workspace=@mlut/core && npm run build --workspace=mlut && npx gulp -f gulpfile.cjs build", + "build:packages": "npm run build --workspace=@mlut/core && npm run build --workspace=mlut && npx gulp -f gulpfile.cjs sass", + "build:docs": "npx gulp -f gulpfile.cjs sass-mk-doc", "build:mlut": "npm run build --workspace=mlut && npx gulp -f gulpfile.cjs sass", "build:core": "npm run build --workspace=@mlut/core", "lint": "npx eslint packages/*/src/ && npx stylelint packages/*/src --ip packages/core/src/sass/tools/mixins/base/_mk-ar.scss",