From 573b102bd680d4461f97c4823b05b9832aa54ce5 Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Mon, 2 Sep 2024 09:34:23 +0200 Subject: [PATCH] feat: add CI for build and check lint JS --- .github/workflows/build-release.yml | 14 +++++++++++++- .github/workflows/js.yml | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/js.yml diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index e5b9b1182d..8693d00693 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -20,10 +20,22 @@ jobs: - name: Install composer dependencies run: composer install --ansi --prefer-dist --no-interaction --no-progress --no-dev + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '20.11.0' + + - name: Install and build npm dependencies + run: + npm install --prefix ./_dev + npm vite:build --prefix ./_dev + - name: Clean-up project uses: PrestaShopCorp/github-action-clean-before-deploy@v2.0 with: - paths: storybook + paths: + - storybook + - _dev - name: Create & upload artifact uses: actions/upload-artifact@v4.1.0 diff --git a/.github/workflows/js.yml b/.github/workflows/js.yml new file mode 100644 index 0000000000..fbd4ceec07 --- /dev/null +++ b/.github/workflows/js.yml @@ -0,0 +1,25 @@ +name: JS tests +on: [push, pull_request] +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + js-linter: + name: JS linter syntax check + runs-on: unbuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.3 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: '20.11.0' + + - name: Install npm dependencies + run: + npm install --prefix ./_dev + + - name: Launch Eslint + run: + npm lint --prefix ./_dev