Fix Gitea compatability issues

This commit is contained in:
adilallo
2025-08-29 16:18:50 -06:00
parent 2667d054e2
commit f7f76a2396
+94 -190
View File
@@ -8,233 +8,137 @@ on:
branches: [main, develop] branches: [main, develop]
jobs: jobs:
# Unit and Integration Tests
test: test:
runs-on: macos-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix: { node-version: [18, 20] }
node-version: [18, 20] env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: "npm" cache: npm
node-options: "--max_old_space_size=4096" - run: npm ci
- run: npm test
- name: Install dependencies # If the Codecov Action fails on Gitea, replace this with the bash uploader below
run: npm ci - name: Upload coverage to Codecov
- name: Run unit and integration tests
run: npm test
- name: Upload coverage reports
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info files: ./coverage/lcov.info
flags: unittests flags: unittests
name: codecov-umbrella
# E2E Tests # Bash uploader alternative (uncomment if the action above has issues)
# - name: Upload coverage to Codecov (bash)
# run: |
# curl -s https://codecov.io/bash > codecov.sh
# bash codecov.sh -t "${{ secrets.CODECOV_TOKEN }}" -f coverage/lcov.info -F unittests
e2e: e2e:
runs-on: macos-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix: { browser: [chromium, firefox, webkit] }
browser: [chromium, firefox, webkit]
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npx playwright install --with-deps ${{ matrix.browser }}
- run: npm run build
- name: Setup Node.js # start app, wait, run tests
uses: actions/setup-node@v4 - run: npm run preview &
with: env: { CI: true }
node-version: 20 - run: npx wait-on http://localhost:3000
cache: "npm" - run: npx playwright test --project=${{ matrix.browser }}
env: { CI: true }
- name: Install dependencies # package artifacts (keeps file count small)
run: npm ci - name: Package E2E artifacts
- name: Install Playwright browsers
run: npx playwright install --with-deps ${{ matrix.browser }}
- name: Build application
run: npm run build
- name: Start application
run: npm run preview &
env:
CI: true
- name: Wait for application to be ready
run: npx wait-on http://localhost:3000
- name: Run E2E tests
run: npx playwright test --project=${{ matrix.browser }}
env:
CI: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always() if: always()
run: |
tar -czf playwright-${{ matrix.browser }}.tgz playwright-report test-results || true
- name: Upload E2E artifacts
if: always()
uses: actions/upload-artifact@v3
with: with:
name: playwright-results-${{ matrix.browser }} name: playwright-results-${{ matrix.browser }}
path: | path: playwright-${{ matrix.browser }}.tgz
test-results/
playwright-report/
retention-days: 30 retention-days: 30
# Visual Regression Tests
visual-regression: visual-regression:
runs-on: macos-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
- run: npm run preview &
env: { CI: true }
- run: npx wait-on http://localhost:3000
- run: npx playwright test tests/e2e/visual-regression.spec.ts
env: { CI: true }
- name: Setup Node.js - name: Package visual artifacts
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Build application
run: npm run build
- name: Start application
run: npm run preview &
env:
CI: true
- name: Wait for application to be ready
run: npx wait-on http://localhost:3000
- name: Run visual regression tests
run: npx playwright test tests/e2e/visual-regression.spec.ts
env:
CI: true
- name: Upload visual regression results
uses: actions/upload-artifact@v4
if: always() if: always()
run: |
tar -czf visual-regression.tgz test-results tests/e2e/visual-regression.spec.ts-snapshots || true
- name: Upload visual artifacts
if: always()
uses: actions/upload-artifact@v3
with: with:
name: visual-regression-results name: visual-regression-results
path: | path: visual-regression.tgz
test-results/
tests/e2e/visual-regression.spec.ts-snapshots/
retention-days: 30 retention-days: 30
# Performance Tests
performance: performance:
runs-on: macos-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run build
- run: npm run preview &
env: { CI: true }
- run: npx wait-on http://localhost:3000
- run: npm run lhci
env: { CI: true }
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Start application
run: npm run preview &
env:
CI: true
- name: Wait for application to be ready
run: npx wait-on http://localhost:3000
- name: Run Lighthouse CI
run: npm run lhci
env:
CI: true
# Storybook Tests
storybook: storybook:
runs-on: macos-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run build-storybook
- run: npm run test:sb
env: { CI: true }
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build Storybook
run: npm run build-storybook
- name: Run Storybook tests
run: npm run test:sb
env:
CI: true
# Lint and Format
lint: lint:
runs-on: macos-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run lint
- run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Check formatting
run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}"
# Build Verification
build: build:
runs-on: macos-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- name: Setup Node.js - run: npm ci
uses: actions/setup-node@v4 - run: npm run build
with: - run: npm run build-storybook
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Build Storybook
run: npm run build-storybook