From 4228545b335605acc0bb08b57e6c6ae245696e2d Mon Sep 17 00:00:00 2001 From: Mudzz Date: Mon, 3 Mar 2025 14:45:45 +0100 Subject: [PATCH 1/3] Changed YAML --- .github/workflows/self-hosted-ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/self-hosted-ci.yml b/.github/workflows/self-hosted-ci.yml index 404a2f4a4..eb4854751 100644 --- a/.github/workflows/self-hosted-ci.yml +++ b/.github/workflows/self-hosted-ci.yml @@ -5,12 +5,10 @@ on: branches: [ main ] pull_request: branches: [ main ] - # Ajout d'un déclencheur manuel pour faciliter les tests workflow_dispatch: jobs: build-and-test: - # Spécifie d'utiliser votre runner auto-hébergé au lieu des runners GitHub runs-on: self-hosted steps: @@ -20,13 +18,21 @@ jobs: - name: Log Node.js version run: node --version - - name: Log available disk space - run: | - echo "Checking available disk space:" - df -h + - name: Cache node modules + uses: actions/cache@v3 + id: npm-cache + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- - name: Install dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' run: npm ci - name: Run tests run: npm test -- --watch=false --browsers=ChromeHeadless --no-progress + + - name: Build application + run: npm run build -- --configuration production From 3d3777a6fd3723b2b327271214e83633528f726a Mon Sep 17 00:00:00 2001 From: Mudzz Date: Mon, 3 Mar 2025 15:02:54 +0100 Subject: [PATCH 2/3] Modification du Runner --- .github/workflows/self-hosted-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/self-hosted-ci.yml b/.github/workflows/self-hosted-ci.yml index eb4854751..1ecfb7a0a 100644 --- a/.github/workflows/self-hosted-ci.yml +++ b/.github/workflows/self-hosted-ci.yml @@ -36,3 +36,16 @@ jobs: - name: Build application run: npm run build -- --configuration production + + cleanup: + runs-on: self-hosted + needs: build-and-test + if: always() + + steps: + - name: Clean workspace + run: | + echo "Cleaning workspace to free up disk space" + rm -rf node_modules || true + rm -rf dist || true + npm cache clean --force || true From 99b9021773105c31c458ff0b9cd80a45a22a9807 Mon Sep 17 00:00:00 2001 From: Mudzz Date: Mon, 3 Mar 2025 15:05:03 +0100 Subject: [PATCH 3/3] Modification du Runner (encore) --- .github/workflows/self-hosted-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/self-hosted-ci.yml b/.github/workflows/self-hosted-ci.yml index 1ecfb7a0a..8ec2e9bd8 100644 --- a/.github/workflows/self-hosted-ci.yml +++ b/.github/workflows/self-hosted-ci.yml @@ -29,7 +29,7 @@ jobs: - name: Install dependencies if: steps.npm-cache.outputs.cache-hit != 'true' - run: npm ci + run: npm ci --force - name: Run tests run: npm test -- --watch=false --browsers=ChromeHeadless --no-progress