diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38d5673..d5ae273 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,16 +41,29 @@ jobs: - name: Unit Tests run: cargo test -p matrix - # - name: Install Just - # uses: extractions/setup-just@v1 + - name: Create a copy of `.env.example` + run: cp ./.env.example ./.env - # - name: Generate Configuration - # run: just gen_synapse_conf + - name: Generate Synapse Configuration + run: | + docker run -i --rm -v ./docker/synapse:/data \ + --env-file .env \ + matrixdotorg/synapse:v1.96.1 generate - # - name: Prepare Data for Tests - # run: docker compose up -d + - name: Use Test Homeserver + run: | + sudo cp -f ./crates/test/fixtures/synapse/homeserver.yaml ./docker/synapse/homeserver.yaml - # - name: E2E Tests - # env: - # COMMUNE_SYNAPSE_HOST: 'http://0.0.0.0:8008' - # run: cargo test -p test -- --test-threads=1 + - name: E2E Tests + run: | + docker compose up -d + sleep 10 + cargo test -p test -- --test-threads=1 + + - name: Print Logs + if: always() + run: | + docker-compose logs --no-color --tail=1000 synapse > synapse.log + cat ./synapse.log + docker compose down + docker ps diff --git a/README.md b/README.md index 8d1852a..824fe70 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ database: - user: synapse_user - password: secretpassword - database: synapse -- host: synapse_database +- host: localhost - port: 5432 - cp_min: 5 - cp_max: 10 diff --git a/docker-compose.yml b/docker-compose.yml index fce631b..950e469 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: env_file: - .env restart: always + network_mode: 'host' depends_on: - synapse_database diff --git a/fixtures/synapse/homeserver.yaml b/fixtures/synapse/homeserver.yaml index a3682fd..7769a09 100644 --- a/fixtures/synapse/homeserver.yaml +++ b/fixtures/synapse/homeserver.yaml @@ -28,7 +28,7 @@ database: user: synapse_user password: secretpassword database: synapse - host: synapse_database + host: localhost port: 5432 cp_min: 5 cp_max: 10