From 3d52df289c59e3002407addd2c2df68c45a7e534 Mon Sep 17 00:00:00 2001 From: Bastien MONTOIS Date: Mon, 13 Nov 2023 16:22:51 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(.eslintrc.cjs):=20add=20ESLint?= =?UTF-8?q?=20configuration=20file=20for=20better=20code=20quality=20contr?= =?UTF-8?q?ol=20=F0=9F=94=A7=20chore(ci.yml):=20update=20GitHub=20Actions?= =?UTF-8?q?=20workflow=20to=20include=20build=20and=20lint=20jobs=20for=20?= =?UTF-8?q?better=20CI/CD=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js => .eslintrc.cjs | 0 .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++----- 2 files changed, 52 insertions(+), 8 deletions(-) rename .eslintrc.js => .eslintrc.cjs (100%) diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acd15bf..597abbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,49 @@ on: jobs: build: + name: Build + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Build + run: npm run build + + lint: + name: Lint + needs: build + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Lint + run: npm run lint + test: + name: Test + needs: build runs-on: ubuntu-latest strategy: @@ -16,11 +58,13 @@ jobs: node-version: [14.x, 16.x, 18.x] steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm install - - run: npm test + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Test + run: npm run test