Marc Roig 43f30b747f
chore: merge develop into v5 main (#21108)
* cron type fix

* Fix typo of query key from 'providers' to 'get-providers'

* Closing #19644 fix filters type

* node-scadule updated + types updated

* Fix formating errors

* fix formatting

* update lock file

* fix patreon oauth 400 error

from lack of user-agent header

* test: backport cli tests (#20433)

* fix(chore): increase specificity of the Lightning icon color (#20467)

* test: temporarily disable broken edit ctb tests on CI (#20481)

* feat(cli): cloud cli commands (v4) (#20119)

* feat(cli): add cloud commands

Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com>
Co-authored-by: nathan-pichon <nathan.pichon@strapi.io>
Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com>

* v4.25.0 (#20500)

* NPS: Update frequency of the NPS (#20492)

* enhancement(admin): change postFirstDismissal and display delays

* enhancement(admin): change the display delay

* fix: prevent use of local ips on webhooks (#20487)

* chore: mask error on webhook manual trigger

* feat: prevent using local ips

* feat: display webhook edit error

* chore: pr suggestion

* chore: api tests

* chore: allow local ips on development

* chore: only run check on production

* feat: include internationalized urls

* fix: prettier

* Add: Strapi deploy command to README files

* v4.25.1

* Update @aws-sdk/client-s3 package

* feat(cli): add browser logout step (#20502)

* feat(cli): add browser log out step

* handle error whiile fetching the config

* Update LICENSE packing for packages for v4 (#20576)

* feat(create-strapi-app): remove the cloud project creation part (#20561)

* feat(create-strapi-app): remove the cloud project creation part

* fix(create-strapi-app): adding new parameter to cloud service instantiation

* Update Yarn to 4.3.1

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* feat(cli): trigger login sequence when token is missing or invalid  (#20572)

* feat(cli): launch login when auth fails

* fix(cli): abstract create project fn

* fix(cli): guidelines

* fix(cli): rebase

---------

Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>

* fix clone entity, #20509 (#20531)

* chore: bump glob from 7.2.0 to 9.0.0

* chore: bump glob to v10.4.2 in core/strapi

* update yarn.lock

* removed redundant packages/core/strapi/src/load/glob.ts file

* v4.25.2 to main (#20676)

* Fix typo of query key from 'providers' to 'get-providers'

* Closing #19644 fix filters type

* fix patreon oauth 400 error

from lack of user-agent header

* Add: Strapi deploy command to README files

* Update @aws-sdk/client-s3 package

* feat(cli): add browser logout step (#20502)

* feat(cli): add browser log out step

* handle error whiile fetching the config

* Update LICENSE packing for packages for v4 (#20576)

* feat(create-strapi-app): remove the cloud project creation part (#20561)

* feat(create-strapi-app): remove the cloud project creation part

* fix(create-strapi-app): adding new parameter to cloud service instantiation

* Update Yarn to 4.3.1

Signed-off-by: Sora Morimoto <sora@morimoto.io>

* feat(cli): trigger login sequence when token is missing or invalid  (#20572)

* feat(cli): launch login when auth fails

* fix(cli): abstract create project fn

* fix(cli): guidelines

* fix(cli): rebase

---------

Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>

* fix: support string array

* fix clone entity, #20509 (#20531)

* v4.25.2

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: smoothdvd <madfxgao@gmail.com>
Co-authored-by: Micah Riggan <micahriggan@gmail.com>
Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com>
Co-authored-by: Maxime Castres <mcastres@student.42.fr>
Co-authored-by: Alex Supkay <asupkay1124@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com>
Co-authored-by: Jean-Sébastien Herbaux <jean-sebastien.herbaux@epitech.eu>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Kirill Verevkin <kira795@yandex.ru>

* v4.25.2 (#20675)

* fix: support string array

* v4.25.2

---------

Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>

* feat(cli): use project name from package json by default (#20479)

* chore: change cloud message in homepage (#20685)

* chore(cloud-cli): migrate to fs-extra (#20695)

* feat(cloud-cli): migrate compress-files.ts to fs-extra

* feat(cloud-cli): migrate pkg.ts to fs-extra

* fix(cloud-cli): update using promises in recursive function

* feat(cli): Add projects list command (#20694)

* feat(cli): projects list command

* fix: updating contributing guide workflow

* chore: release v4.25.3 (#20722)

* fix: invalid path separator (#20740)

* fix: invalid path separator

* fix: prettier

* v4.25.4 to develop (#20832)

* 4.25.4 to main (#20833)

* cron type fix

* node-scadule updated + types updated

* Fix formating errors

* fix formatting

* update lock file

* chore(cloud-cli): migrate to fs-extra (#20695)

* feat(cloud-cli): migrate compress-files.ts to fs-extra

* feat(cloud-cli): migrate pkg.ts to fs-extra

* fix(cloud-cli): update using promises in recursive function

* feat(cli): Add projects list command (#20694)

* feat(cli): projects list command

* fix: invalid path separator (#20740)

* fix: invalid path separator

* fix: prettier

* v4.25.4

---------

Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>
Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>

* Chore: Removing some people from the issue auto-assignment

Removing Simen and Nick from the array of people issues will be auto-assigned to

* fix(cloud-cli): avoid blocking event loop in deploy command (#20850)

* chore(cloud-cli): update error handling for config and logs at the ends of function execution

* fix(cloud-cli): clear timeout before returning - free the event loop from waiting

* feat(cli): add project link command to cloud cli (#20714)

* feat(cli): add link command

* 4.25.5 to main (#20873)

* cron type fix

* node-scadule updated + types updated

* Fix formating errors

* fix formatting

* update lock file

* chore(cloud-cli): migrate to fs-extra (#20695)

* feat(cloud-cli): migrate compress-files.ts to fs-extra

* feat(cloud-cli): migrate pkg.ts to fs-extra

* fix(cloud-cli): update using promises in recursive function

* feat(cli): Add projects list command (#20694)

* feat(cli): projects list command

* fix: updating contributing guide workflow

* fix: invalid path separator (#20740)

* fix: invalid path separator

* fix: prettier

* v4.25.4 to develop (#20832)

* Chore: Removing some people from the issue auto-assignment

Removing Simen and Nick from the array of people issues will be auto-assigned to

* fix(cloud-cli): avoid blocking event loop in deploy command (#20850)

* chore(cloud-cli): update error handling for config and logs at the ends of function execution

* fix(cloud-cli): clear timeout before returning - free the event loop from waiting

* feat(cli): add project link command to cloud cli (#20714)

* feat(cli): add link command

* v4.25.5

---------

Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>
Co-authored-by: José Luis <alagunasalahaddin@live.com>
Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
Co-authored-by: DMehaffy <derrickmehaffy@gmail.com>

* v4.25.5 to develop (#20872)

* 4.25.4 to main (#20833)

* cron type fix

* node-scadule updated + types updated

* Fix formating errors

* fix formatting

* update lock file

* chore(cloud-cli): migrate to fs-extra (#20695)

* feat(cloud-cli): migrate compress-files.ts to fs-extra

* feat(cloud-cli): migrate pkg.ts to fs-extra

* fix(cloud-cli): update using promises in recursive function

* feat(cli): Add projects list command (#20694)

* feat(cli): projects list command

* fix: invalid path separator (#20740)

* fix: invalid path separator

* fix: prettier

* v4.25.4

---------

Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>
Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>

* v4.25.5

---------

Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Gonzalo Andres Garcia <nouvellegon@gmail.com>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>

* fix custom email provider test issue #19122 (#19123)

* fix custom email provider test issue #19122

* chore(email): prettier clean up

---------

Co-authored-by: Jamie Howard <jamie.howard@strapi.io>

* Changed Discord username to fit change Discord made.

* v4.25.6

* fix(cli): Update 'project not found' error message in deploy command (#20923)

* chore: aggregate test result to add a single required status check and make it dynamic

* shard ee tests+ fix broken platform (#20914)

* v4.25.7

* RBAC Action Aliases - v4 (#20954)

* test(cli): add list command tests (#20949)

* feat(cloud-cli): preselect node-version based on local node-version (#20959)

* [Fix] Validate cloning as entity creation so field validations aren't skipped e.g. unique constraints (#20963)

* flatten CI workflow tests (#20969)

* v4.25.8 release to develop (#21011)

* Removing workflows the support team doesn't need anymore

* chore: getstarted schema sync between v4-v5 (#21047)

* Chore(CLI): Add validation to prevent deployment of suspended projects (#20976)

* chore(cli): check project suspension

* Prettier fix

* chore(deps): update axios to 1.7.4 (#21014)

* fix(cli): Update endpoint path for listLinkProjects (#21052)

* chore: update lint-staged to 15.2.9 (#21075)

* v4.25.9

* fix: issue 21079

* fix: rich text selection & deletion issues

* fix: build

* fix: type

* fix: skip failing cli tests

* chore: fix jest options in ci

---------

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Boegie19 <34578426+Boegie19@users.noreply.github.com>
Co-authored-by: smoothdvd <madfxgao@gmail.com>
Co-authored-by: Micah Riggan <micahriggan@gmail.com>
Co-authored-by: Tewson Seeoun <tewson.seeoun@gmail.com>
Co-authored-by: Ben Irvin <ben.irvin@strapi.io>
Co-authored-by: Simone <startae14@gmail.com>
Co-authored-by: Nathan Pichon <nathan.pichon@strapi.io>
Co-authored-by: Gonzalo Garcia <nouvellegon@gmail.com>
Co-authored-by: Abdallah M <55534657+abdallahmz@users.noreply.github.com>
Co-authored-by: Maxime Castres <mcastres@student.42.fr>
Co-authored-by: Convly <jean-sebastien.herbaux@epitech.eu>
Co-authored-by: Alex Supkay <asupkay1124@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
Co-authored-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
Co-authored-by: Kirill Verevkin <kira795@yandex.ru>
Co-authored-by: chrismuiruriz <chrismuiruri007@gmail.com>
Co-authored-by: José Luis <alagunasalahaddin@live.com>
Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com>
Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io>
Co-authored-by: DMehaffy <derrickmehaffy@gmail.com>
Co-authored-by: ahallaha <104538552+ahallaha@users.noreply.github.com>
Co-authored-by: Jamie Howard <jamie.howard@strapi.io>
Co-authored-by: mallowsc <mallowsc@outlook.com>
Co-authored-by: Jamie Howard <48524071+jhoward1994@users.noreply.github.com>
Co-authored-by: mallowsc <96073136+mallowsc@users.noreply.github.com>
Co-authored-by: Olli Hiekkaranta <Ohiekkar@users.noreply.github.com>
2024-09-02 14:31:01 +02:00

511 lines
15 KiB
YAML

name: 'Tests'
on:
push:
branches:
- main
- develop
- v5/main
pull_request:
paths-ignore:
- 'docs/**'
- '**.mdx?'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
actions: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/filters.yaml
pretty:
name: 'pretty (node: 20)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: nrwl/nx-set-shas@v4
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Run lint
run: yarn prettier:check
lint:
name: 'lint (node: 20)'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: nrwl/nx-set-shas@v4
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run lint
run: yarn nx affected --target=lint --parallel --nx-ignore-cycles
build:
name: 'build (node: 20)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
typescript:
name: 'typescript'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: nrwl/nx-set-shas@v4
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- name: TSC for packages
run: yarn nx affected --target=test:ts --nx-ignore-cycles
- name: TSC for back
run: yarn nx affected --target=test:ts:back --nx-ignore-cycles
- name: TSC for front
run: yarn nx affected --target=test:ts:front --nx-ignore-cycles
unit_back:
name: 'unit_back (node: ${{ matrix.node }})'
needs: [changes, build]
runs-on: ubuntu-latest
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
strategy:
matrix:
node: [18, 20]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: nrwl/nx-set-shas@v4
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run tests
run: yarn nx affected --target=test:unit --nx-ignore-cycles
unit_front:
name: 'unit_front (node: ${{ matrix.node }})'
needs: [changes, build]
runs-on: ubuntu-latest
strategy:
matrix:
node: [20]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: nrwl/nx-set-shas@v4
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run test
run: yarn nx affected --target=test:front --nx-ignore-cycles -- --runInBand
e2e_ce:
timeout-minutes: 60
needs: [changes, build]
name: '[CE] e2e (browser: ${{ matrix.project }})'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: ['chromium', 'webkit', 'firefox']
shard: [1/2, 2/2]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Install Playwright Browsers
run: npx playwright@1.42.1 install --with-deps
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run [CE] E2E tests
uses: ./.github/actions/run-e2e-tests
with:
runEE: false
jestOptions: '--project=${{ matrix.project }} --shard=${{ matrix.shard }}'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ce-${{ matrix.project }}--playwright-trace
path: test-apps/e2e/test-results/**/trace.zip
retention-days: 1
e2e_ee:
timeout-minutes: 60
needs: [changes, build]
name: '[EE] e2e (browser: ${{ matrix.project }})'
runs-on: ubuntu-latest
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
fail-fast: false
matrix:
project: ['chromium', 'webkit', 'firefox']
shard: [1/2, 2/2]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Install Playwright Browsers
run: npx playwright@1.42.1 install --with-deps
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run [EE] E2E tests
uses: ./.github/actions/run-e2e-tests
with:
runEE: true
enableFutureFeatures: true
jestOptions: '--project=${{ matrix.project }} --shard=${{ matrix.shard }}'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ee-${{ matrix.project }}--playwright-trace
path: test-apps/e2e/test-results/**/trace.zip
retention-days: 1
cli:
timeout-minutes: 60
needs: [changes, build, typescript]
name: 'CLI Tests'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- name: Run CLI tests
run: yarn test:cli
api_ce_pg:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [changes, build]
name: '[CE] API Integration (postgres, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
services:
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: strapi
POSTGRES_PASSWORD: strapi
POSTGRES_DB: strapi_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
-v /__w/.github/workflows/db/postgres:/docker-entrypoint-initdb.d
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
jestOptions: '--shard=${{ matrix.shard }}'
api_ce_mysql:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [changes, build, typescript, unit_back, unit_front]
name: '[CE] API Integration (mysql:latest, package: mysql2}, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
services:
mysql:
image: bitnami/mysql:latest
env:
MYSQL_ROOT_PASSWORD: strapi
MYSQL_USER: strapi
MYSQL_PASSWORD: strapi
MYSQL_DATABASE: strapi_test
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
# Maps tcp port 5432 on service container to the host
- 3306:3306
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=${{ matrix.db_client }} --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
jestOptions: '--shard=${{ matrix.shard }}'
api_ce_sqlite:
if: needs.changes.outputs.backend == 'true'
runs-on: ubuntu-latest
needs: [changes, build, typescript, unit_back, unit_front]
name: '[CE] API Integration (sqlite, package: better-sqlite3, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=sqlite --dbfile=./tmp/data.db'
jestOptions: '--shard=${{ matrix.shard }}'
# EE
api_ee_pg:
runs-on: ubuntu-latest
needs: [changes, build]
name: '[EE] API Integration (postgres, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
services:
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_USER: strapi
POSTGRES_PASSWORD: strapi
POSTGRES_DB: strapi_test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
-v /__w/.github/workflows/db/postgres:/docker-entrypoint-initdb.d
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
runEE: true
jestOptions: '--shard=${{ matrix.shard }}'
api_ee_mysql:
runs-on: ubuntu-latest
needs: [changes, build, typescript, unit_back, unit_front]
name: '[EE] API Integration (mysql:latest, package: mysql2, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
services:
mysql:
image: bitnami/mysql:latest
env:
MYSQL_ROOT_PASSWORD: strapi
MYSQL_USER: strapi
MYSQL_PASSWORD: strapi
MYSQL_DATABASE: strapi_test
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
ports:
# Maps tcp port 5432 on service container to the host
- 3306:3306
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
runEE: true
jestOptions: '--shard=${{ matrix.shard }}'
api_ee_sqlite:
runs-on: ubuntu-latest
needs: [changes, build, typescript, unit_back, unit_front]
name: '[EE] API Integration (sqlite, client: better-sqlite3, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})'
if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]')
env:
STRAPI_LICENSE: ${{ secrets.strapiLicense }}
strategy:
matrix:
node: [18, 20]
shard: [1/5, 2/5, 3/5, 4/5, 5/5]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: Monorepo build
uses: ./.github/actions/run-build
- uses: ./.github/actions/run-api-tests
with:
dbOptions: '--dbclient=sqlite --dbfile=./tmp/data.db'
runEE: true
jestOptions: '--shard=${{ matrix.shard }}'
test_result:
if: ${{ always() }}
runs-on: ubuntu-latest
name: aggregate_test_result
needs:
[
pretty,
lint,
build,
typescript,
unit_back,
unit_front,
e2e_ce,
e2e_ee,
cli,
api_ce_pg,
api_ce_mysql,
api_ce_sqlite,
api_ee_pg,
api_ee_mysql,
api_ee_sqlite,
]
steps:
- run: exit 1
if: >-
${{
contains(needs.*.result, 'failure')
|| contains(needs.*.result, 'cancelled')
}}