fix: invoice duplicate #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Tests | |
| on: | |
| pull_request: | |
| branches: [ main, master ] | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| functions-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: functions/package-lock.json | |
| - name: Install functions dependencies | |
| run: | | |
| cd functions | |
| npm ci | |
| - name: Run functions tests with coverage | |
| run: | | |
| cd functions | |
| npm run test:coverage -- --ci --reporters=default --reporters=jest-junit | |
| env: | |
| CI: true | |
| NODE_ENV: test | |
| JEST_JUNIT_OUTPUT_DIR: ./test-results | |
| JEST_JUNIT_OUTPUT_NAME: junit.xml | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: functions-test-results | |
| path: functions/test-results/junit.xml | |
| retention-days: 7 | |
| - name: Upload coverage reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: functions-coverage-report | |
| path: functions/coverage/ | |
| retention-days: 7 | |
| - name: Test Summary | |
| if: always() | |
| uses: test-summary/action@v2 | |
| with: | |
| paths: | | |
| functions/test-results/junit.xml | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Create test directories | |
| run: mkdir -p tests/e2e/screenshots | |
| # Install Chrome dependencies for Puppeteer | |
| # These are required system libraries that Chrome needs to run on Ubuntu | |
| - name: Install Chrome dependencies | |
| run: | | |
| sudo apt-get update | |
| # Using npx to run Puppeteer's built-in script that knows exactly what Chrome needs | |
| npx puppeteer browsers install chrome | |
| # Install only the missing system dependencies | |
| sudo apt-get install -y libnss3 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 | |
| - name: Run E2E tests | |
| run: npm run test:e2e:ci | |
| env: | |
| HEADLESS: true | |
| CI: true | |
| # Set the correct URL for the preview server in CI | |
| TEST_URL: http://localhost:3000 | |
| # Firebase configuration for the test build | |
| VITE_FIREBASE_API_KEY: ${{ secrets.VITE_FIREBASE_API_KEY }} | |
| VITE_FIREBASE_AUTH_DOMAIN: ${{ secrets.VITE_FIREBASE_AUTH_DOMAIN }} | |
| VITE_FIREBASE_PROJECT_ID: ${{ secrets.VITE_FIREBASE_PROJECT_ID }} | |
| VITE_FIREBASE_STORAGE_BUCKET: ${{ secrets.VITE_FIREBASE_STORAGE_BUCKET }} | |
| VITE_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.VITE_FIREBASE_MESSAGING_SENDER_ID }} | |
| VITE_FIREBASE_APP_ID: ${{ secrets.VITE_FIREBASE_APP_ID }} | |
| - name: Upload test screenshots on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-screenshots | |
| path: tests/e2e/screenshots/ | |
| retention-days: 7 | |