From 9d96d366bf60197d0472913d9564d9c6268e3a65 Mon Sep 17 00:00:00 2001 From: deco Date: Wed, 16 Jul 2025 05:40:46 +0300 Subject: [PATCH] Update .forgejo/workflows/build-check.yml --- .forgejo/workflows/build-check.yml | 126 ++++++++++++++--------------- 1 file changed, 60 insertions(+), 66 deletions(-) diff --git a/.forgejo/workflows/build-check.yml b/.forgejo/workflows/build-check.yml index 9a22e5b..6543cf4 100644 --- a/.forgejo/workflows/build-check.yml +++ b/.forgejo/workflows/build-check.yml @@ -1,66 +1,60 @@ -# Workflow for building and testing Next.js site on non-master branches -name: Build Check - -on: - # Runs on pushes to any branch except master - push: - branches-ignore: ["master"] - - # Runs on pull requests targeting any branch - pull_request: - branches: ["*"] - -# Allow multiple concurrent build checks -concurrency: - group: "build-check-${{ github.ref }}" - cancel-in-progress: true - -jobs: - build-check: - runs-on: self-hosted - permissions: - contents: read - steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - - - name: Setup Node.js - uses: https://code.forgejo.org/actions/setup-node@v4 - with: - node-version: "20" - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Restore Next.js cache - uses: https://code.forgejo.org/actions/cache@v4 - with: - path: | - .next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - - - name: Run linting - run: npm run lint - - - name: Build Next.js site - run: npm run build - - - name: Run tests (if available) - run: | - if npm run test --if-present; then - echo "✅ Tests passed" - else - echo "â„šī¸ No tests found or tests skipped" - fi - continue-on-error: true - - - name: Build verification complete - run: | - echo "🎉 Build verification successful!" - echo "✅ Dependencies installed" - echo "✅ Linting passed" - echo "✅ Build completed successfully" - echo "Ready for review and merge!" +# Workflow for building and testing Next.js site on non-master branches +name: Build Check + +on: + # Runs on pushes to any branch except master + push: + branches-ignore: ["master"] + + # Runs on pull requests targeting any branch + pull_request: + branches: ["*"] + +# Allow multiple concurrent build checks +concurrency: + group: "build-check-${{ github.ref }}" + cancel-in-progress: true + +jobs: + build-check: + runs-on: self-hosted + permissions: + contents: read + steps: + - name: Checkout + uses: https://code.forgejo.org/actions/checkout@v4 + + - name: Install dependencies + run: npm ci + + - name: Restore Next.js cache + uses: https://code.forgejo.org/actions/cache@v4 + with: + path: | + .next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + + - name: Run linting + run: npm run lint + + - name: Build Next.js site + run: npm run build + + - name: Run tests (if available) + run: | + if npm run test --if-present; then + echo "✅ Tests passed" + else + echo "â„šī¸ No tests found or tests skipped" + fi + continue-on-error: true + + - name: Build verification complete + run: | + echo "🎉 Build verification successful!" + echo "✅ Dependencies installed" + echo "✅ Linting passed" + echo "✅ Build completed successfully" + echo "Ready for review and merge!"