nginx healthcheck #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Workflow | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
GH_TOKEN: "${{secrets.GH_TOKEN}}" | |
FRONTEND_REPO_URL: "github.com/perfetti/react1-app.git" | |
BACKEND_REPO_URL: "github.com/perfetti/react2-app.git" | |
API_REPO_URL: "github.com/perfetti/rails-app.git" | |
FRONTEND_REF: "main" | |
BACKEND_REF: "main" | |
API_REF: "main" | |
FRONTEND_PUBLIC_URL: "//localhost:8089/" | |
BACKEND_PUBLIC_URL: "//localhost:8089/backend/" | |
WDS_SOCKET_PORT: "8089" | |
POSTGRES_USER: "postgres" | |
POSTGRES_PASSWORD: "postgres" | |
POSTGRES_DB: "perfetti" | |
RAILS_HOST: "api" | |
RAILS_ENV: "test" | |
DATABASE_HOST: "db" | |
DATABASE_USERNAME: "postgres" | |
RAILS_RELATIVE_URL_ROOT: "/api" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: KengoTODA/actions-setup-docker-compose@v1 | |
with: | |
version: "2.14.2" | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: false | |
- name: Build and start Docker Compose services | |
run: bash ./setup_github.sh && docker compose up --build -d | |
- name: check dns is working | |
run: netstat -tulpn # Use -tulpn to show TCP/UDP listeners | |
- name: Wait for services to be ready | |
run: | | |
# Wait for nginx to be ready | |
timeout 60s bash -c 'while ! curl -s http://localhost:8089 > /dev/null; do sleep 1; done' | |
- name: Run E2E tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config: pageLoadTimeout=100000,baseUrl=http://localhost:8089 | |
working-directory: test/ | |
- name: Save artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
if-no-files-found: error | |
path: build | |
- name: Tear down Docker Compose services | |
run: docker-compose down |