mirror of
https://github.com/directus/directus.git
synced 2026-01-10 03:47:57 -05:00
93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
name: Blackbox Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- api/**
|
|
- tests/blackbox/**
|
|
- packages/**
|
|
- package.json
|
|
- pnpm-lock.yaml
|
|
- .github/workflows/blackbox.yml
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: blackbox-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=6144
|
|
|
|
jobs:
|
|
common:
|
|
name: common
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare
|
|
uses: ./.github/actions/prepare
|
|
|
|
- name: Start services
|
|
run:
|
|
docker compose -f tests/blackbox/docker-compose.yml up auth-saml redis minio minio-mc -d --quiet-pull --wait
|
|
|
|
- name: Run tests
|
|
run: TEST_DB=sqlite3 pnpm run test:blackbox --project common
|
|
|
|
db:
|
|
name: ${{ matrix.vendor }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
vendor:
|
|
- sqlite3
|
|
- postgres
|
|
- mysql
|
|
- maria
|
|
- mssql
|
|
- oracle
|
|
# - cockroachdb
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare
|
|
uses: ./.github/actions/prepare
|
|
|
|
- name: Start database
|
|
if: matrix.vendor != 'sqlite3'
|
|
run: docker compose -f tests/blackbox/docker-compose.yml up ${{ matrix.vendor }} -d --quiet-pull --wait
|
|
|
|
- name: MSSQL Set Compatibility Level
|
|
if: matrix.vendor == 'mssql'
|
|
run: |
|
|
for i in {1..30}
|
|
do
|
|
docker exec blackbox-mssql-1 \
|
|
/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'Test@123' -C \
|
|
-Q "SELECT 1" && break
|
|
sleep 2
|
|
done
|
|
docker exec blackbox-mssql-1 \
|
|
/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'Test@123' -C \
|
|
-Q "ALTER DATABASE model SET COMPATIBILITY_LEVEL = 150" \
|
|
-l 30
|
|
echo "MSSQL compatibility level set successfully"
|
|
|
|
- name: Start services
|
|
run:
|
|
docker compose -f tests/blackbox/docker-compose.yml up auth-saml redis minio minio-mc -d --quiet-pull --wait
|
|
|
|
- name: Run tests
|
|
run: TEST_DB=${{ matrix.vendor }} pnpm run test:blackbox --project db
|