From c67485e2ec01bf3d316d9d8487cc5740210e3525 Mon Sep 17 00:00:00 2001 From: BreizhHardware Date: Tue, 15 Oct 2024 12:55:31 +0200 Subject: [PATCH] Update unit-test --- .github/workflows/unit-test.yml | 41 +++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 144bcb8..104bc03 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -6,9 +6,8 @@ on: - '**' jobs: - build-and-deploy: + build: runs-on: ubuntu-latest - environment: recette steps: - name: Checkout code @@ -21,10 +20,38 @@ jobs: with: node-version: '20' - - name: Install dependencies and build - run: | - npm ci - npm run build + - name: Install dependencies + run: npm ci + + - name: Build project + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: ./dist + + test: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: ./dist - name: Install http-server run: npm install --save-dev http-server @@ -55,4 +82,4 @@ jobs: port: ${{ secrets.SERVER_PORT }} uploads: | ./dist => /var/www/modelec.club - dry-run: true + dry-run: true \ No newline at end of file