| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- name: Build & Test Branches
- on:
- push:
- branches:
- - major
- - minor
- - parallel-e2e
- paths:
- - 'packages/**'
- - 'package.json'
- - 'package-lock.json'
- env:
- CI: true
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
- jobs:
- codegen:
- uses: ./.github/workflows/codegen.yml
- build:
- name: build
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node: [20.x, 22.x]
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ matrix.node }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node }}
- - name: npm install
- run: |
- npm install
- npm install --os=linux --cpu=x64 sharp
- - name: Build
- run: npm run build
- unit-tests:
- name: unit tests
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node: [20.x, 22.x]
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ matrix.node }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node }}
- - name: npm install
- run: |
- npm install
- npm install --os=linux --cpu=x64 sharp
- - name: Build
- run: npx lerna run ci
- - name: Unit tests
- run: npm run test
- e2e-tests:
- name: e2e tests
- runs-on: ubuntu-latest
- services:
- mariadb:
- image: bitnami/mariadb:10.3
- env:
- MARIADB_ROOT_USER: vendure
- MARIADB_ROOT_PASSWORD: password
- ports:
- - 3306
- options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
- mysql:
- image: bitnami/mysql:8.0
- env:
- MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
- MYSQL_ROOT_USER: vendure
- MYSQL_ROOT_PASSWORD: password
- ports:
- - 3306
- options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=20s --health-retries=10
- postgres:
- image: postgres:16
- env:
- POSTGRES_USER: vendure
- POSTGRES_PASSWORD: password
- ports:
- - 5432
- options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
- elastic:
- image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
- env:
- discovery.type: single-node
- bootstrap.memory_lock: true
- ES_JAVA_OPTS: -Xms512m -Xmx512m
- # Elasticsearch will force read-only mode when total available disk space is less than 5%. Since we will
- # be running on a shared Azure instance with 84GB SSD, we easily go below 5% available even when there are still
- # > 3GB free. So we set this value to an absolute one rather than a percentage to prevent all the Elasticsearch
- # e2e tests from failing.
- cluster.routing.allocation.disk.watermark.low: 500mb
- cluster.routing.allocation.disk.watermark.high: 200mb
- cluster.routing.allocation.disk.watermark.flood_stage: 100mb
- ports:
- - 9200
- options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
- redis:
- image: bitnami/redis:7.4.1
- env:
- ALLOW_EMPTY_PASSWORD: yes
- ports:
- - 6379
- strategy:
- fail-fast: false
- matrix:
- node: [20.x, 22.x]
- db: [sqljs, mariadb, mysql, postgres]
- steps:
- - uses: actions/checkout@v4
- - name: Use Node.js ${{ matrix.node }}
- uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node }}
- - name: npm install
- run: |
- npm install
- npm install --os=linux --cpu=x64 sharp
- - name: Build
- run: npx lerna run ci
- - name: e2e tests
- env:
- E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
- E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
- E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
- E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
- E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
- DB: ${{ matrix.db }}
- run: npm run e2e
|