output the docker bound ports #64
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: cat /etc/hosts; netstat -tulpn # Use -tulpn to show TCP/UDP listeners | |
- name: Check what services are on what port | |
run: docker ps --format "table {{.Names}}\t{{.Ports}}" | |
- name: Run E2E tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config: pageLoadTimeout=100000,baseUrl=127.0.0.1:80 | |
working-directory: test/ | |
- name: Run unit tests | |
run: docker compose run test npx cypress run | |
- 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 |