diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 64d1182..9a8ca36 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,15 +10,35 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'yarn' + node-version: '25' + # We handle caching manually below to ensure + # corepack-managed yarn is used correctly. - - name: Install + - name: Enable Corepack + run: | + corepack enable + corepack prepare yarn@stable --activate + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Persistent Yarn Cache + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies run: yarn install --frozen-lockfile --prefer-offline - name: Build Svelte App diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 0ef1c15..33df9a7 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -15,15 +15,35 @@ jobs: pipeline: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Setup Node + - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'yarn' + node-version: '25' + # We handle caching manually below to ensure + # corepack-managed yarn is used correctly. - - name: Install + - name: Enable Corepack + run: | + corepack enable + corepack prepare yarn@stable --activate + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Persistent Yarn Cache + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies run: yarn install --frozen-lockfile --prefer-offline - name: Validation @@ -35,8 +55,3 @@ jobs: run: yarn build env: NODE_ENV: production - - - name: Deploy Step - run: | - echo "Deploying dist/ to ${{ github.event.inputs.environment || 'production' }}..." - # EXAMPLE: rsync -avz dist/ user@your-vps:/var/www/html/ diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index bb9c2c3..c00a8c7 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -28,8 +28,14 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'yarn' + node-version: '25' + # We handle caching manually below to ensure + # corepack-managed yarn is used correctly. + + - name: Enable Corepack + run: | + corepack enable + corepack prepare yarn@stable --activate - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 63b0077..8eb8170 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -11,13 +11,35 @@ jobs: name: Svelte Checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'yarn' + - name: Checkout repository + uses: actions/checkout@v4 - - name: Install + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '25' + # We handle caching manually below to ensure + # corepack-managed yarn is used correctly. + + - name: Enable Corepack + run: | + corepack enable + corepack prepare yarn@stable --activate + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Persistent Yarn Cache + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies run: yarn install --frozen-lockfile --prefer-offline - name: Type Check @@ -25,45 +47,3 @@ jobs: - name: Lint run: yarn oxlint . - - # e2e-tests: - # name: E2E Tests (Playwright) - # runs-on: ubuntu-latest - # - # steps: - # - name: Checkout repository - # uses: actions/checkout@v4 - # - # - name: Setup Node.js - # uses: actions/setup-node@v4 - # with: - # node-version: '20' - # cache: 'yarn' - # - # - name: Install dependencies - # run: yarn install --frozen-lockfile - # - # - name: Install Playwright browsers - # run: yarn playwright install --with-deps - # - # - name: Run Playwright tests - # run: yarn test:e2e - # - # - name: Upload Playwright report - # if: always() - # uses: actions/upload-artifact@v4 - # with: - # name: playwright-report - # path: playwright-report/ - # retention-days: 7 - # - # - name: Upload Playwright screenshots (on failure) - # if: failure() - # uses: actions/upload-artifact@v4 - # with: - # name: playwright-screenshots - # path: test-results/ - # retention-days: 7 - # - # Note: E2E tests are disabled until Playwright setup is complete. - # Uncomment this job section when Playwright tests are ready to run.