mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
91 lines
No EOL
2.2 KiB
YAML
91 lines
No EOL
2.2 KiB
YAML
image: denoland/deno:2.2.2
|
|
|
|
default:
|
|
interruptible: true
|
|
|
|
stages:
|
|
- test
|
|
- e2e-setup
|
|
- e2e-test
|
|
|
|
# Original test stage
|
|
test:
|
|
stage: test
|
|
timeout: 2 minutes
|
|
script:
|
|
- deno fmt --check
|
|
- deno task lint
|
|
- deno task check
|
|
- deno task test --ignore=packages/transcode --coverage=cov_profile
|
|
- deno coverage cov_profile
|
|
coverage: /All files[^\|]*\|[^\|]*\s+([\d\.]+)/
|
|
services:
|
|
- postgres:16
|
|
variables:
|
|
DITTO_NSEC: nsec1zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs4rm7hz
|
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
RUST_BACKTRACE: 1
|
|
artifacts:
|
|
when: always
|
|
paths:
|
|
- deno-test.xml
|
|
reports:
|
|
junit: deno-test.xml
|
|
|
|
# Start E2E environment
|
|
e2e-environment:
|
|
stage: e2e-setup
|
|
image: ubuntu:22.04
|
|
before_script:
|
|
# Install required packages
|
|
- apt update
|
|
- apt install -y ca-certificates curl
|
|
|
|
# Install docker via helper script
|
|
- curl -fsSL https://get.docker.com | bash
|
|
script:
|
|
- docker compose -f docker-compose.test.yml up -d --build
|
|
- end=$((SECONDS + 30))
|
|
- |
|
|
while [[ $SECONDS -lt $end ]] && ! curl -fs http://localhost:4036 >/dev/null; do
|
|
echo "Waiting for localhost:4036..."
|
|
sleep 1
|
|
done
|
|
# Generate dynamic child pipeline config
|
|
- |
|
|
cat > child-pipeline.yml << EOF
|
|
playwright-tests:
|
|
trigger:
|
|
project: soapbox-pub/ditto-playwright
|
|
strategy: depend
|
|
variables:
|
|
BASE_URL: http://localhost:4036
|
|
CI_PROJECT_ID: ${CI_PROJECT_ID}
|
|
CI_MERGE_REQUEST_IID: ${CI_MERGE_REQUEST_IID}
|
|
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
|
CI_COMMIT_SHORT_SHA: ${CI_COMMIT_SHORT_SHA}
|
|
CI_COMMIT_REF_NAME: ${CI_COMMIT_REF_NAME}
|
|
EOF
|
|
artifacts:
|
|
paths:
|
|
- child-pipeline.yml
|
|
only:
|
|
- merge_requests
|
|
|
|
# Trigger child pipeline
|
|
e2e-test:
|
|
stage: e2e-test
|
|
trigger:
|
|
include:
|
|
- artifact: child-pipeline.yml
|
|
job: e2e-environment
|
|
strategy: depend
|
|
needs:
|
|
- e2e-environment
|
|
variables:
|
|
BASE_URL: http://localhost:4036
|
|
# after_script:
|
|
# - docker compose -f docker-compose.test.yml down -v
|
|
only:
|
|
- merge_requests |