chore: try testing in the ci against node 22 & 24 as well as pg, mysq… #103
Workflow file for this run
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| install: | |
| name: 'install (node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Cache dependencies | |
| id: dependencies-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Install dependencies | |
| if: steps.dependencies-cache.outputs.cache-hit != 'true' | |
| run: pnpm install | |
| build: | |
| needs: [install] | |
| name: 'build (node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Cache build outputs | |
| id: build-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run build | |
| if: steps.build-cache.outputs.cache-hit != 'true' | |
| run: pnpm run build | |
| lint: | |
| needs: [install, build] | |
| name: 'lint (node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Run linting | |
| run: pnpm run lint | |
| typescript: | |
| needs: [install, build] | |
| name: 'typescript (node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run TypeScript checks | |
| run: pnpm run check-types | |
| test-integration-sqlite: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:integration (sqlite, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| env: | |
| DATABASE_CLIENT: sqlite | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run integration tests | |
| run: pnpm run test:integration | |
| test-integration-postgres: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:integration (postgres, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: strapi | |
| POSTGRES_PASSWORD: strapi | |
| POSTGRES_DB: strapi_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_CLIENT: postgres | |
| DATABASE_HOST: localhost | |
| DATABASE_PORT: 5432 | |
| DATABASE_NAME: strapi_test | |
| DATABASE_USERNAME: strapi | |
| DATABASE_PASSWORD: strapi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run integration tests | |
| run: pnpm run test:integration | |
| test-integration-mysql: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:integration (mysql, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| services: | |
| mysql: | |
| image: mysql:8 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: strapi_test | |
| MYSQL_USER: strapi | |
| MYSQL_PASSWORD: strapi | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd "mysqladmin ping -h 127.0.0.1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_CLIENT: mysql | |
| DATABASE_HOST: 127.0.0.1 | |
| DATABASE_PORT: 3306 | |
| DATABASE_NAME: strapi_test | |
| DATABASE_USERNAME: strapi | |
| DATABASE_PASSWORD: strapi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run integration tests | |
| run: pnpm run test:integration | |
| test-e2e-sqlite: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:e2e (sqlite, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| env: | |
| DATABASE_CLIENT: sqlite | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run e2e tests | |
| run: pnpm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-node${{ matrix.node-version }}-sqlite | |
| path: '**/playwright-report/' | |
| retention-days: 30 | |
| test-e2e-postgres: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:e2e (postgres, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: strapi | |
| POSTGRES_PASSWORD: strapi | |
| POSTGRES_DB: strapi_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_CLIENT: postgres | |
| DATABASE_HOST: localhost | |
| DATABASE_PORT: 5432 | |
| DATABASE_NAME: strapi_test | |
| DATABASE_USERNAME: strapi | |
| DATABASE_PASSWORD: strapi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run e2e tests | |
| run: pnpm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-node${{ matrix.node-version }}-postgres | |
| path: '**/playwright-report/' | |
| retention-days: 30 | |
| test-e2e-mysql: | |
| needs: [install, build, lint, typescript] | |
| name: 'test:e2e (mysql, node ${{ matrix.node-version }})' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [22, 24] | |
| services: | |
| mysql: | |
| image: mysql:8 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: strapi_test | |
| MYSQL_USER: strapi | |
| MYSQL_PASSWORD: strapi | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd "mysqladmin ping -h 127.0.0.1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_CLIENT: mysql | |
| DATABASE_HOST: 127.0.0.1 | |
| DATABASE_PORT: 3306 | |
| DATABASE_NAME: strapi_test | |
| DATABASE_USERNAME: strapi | |
| DATABASE_PASSWORD: strapi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.18.1 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'pnpm' | |
| - name: Restore dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | |
| - name: Restore build outputs | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| packages/*/dist | |
| apps/*/dist | |
| key: ${{ runner.os }}-node${{ matrix.node-version }}-build-${{ hashFiles('pnpm-lock.yaml', 'packages/**', 'apps/**') }} | |
| - name: Run e2e tests | |
| run: pnpm run test:e2e | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report-node${{ matrix.node-version }}-mysql | |
| path: '**/playwright-report/' | |
| retention-days: 30 |