Fixing local development experience #141
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 ./bin/build_github.sh | |
- 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}}" && docker compose ps | |
- name: Wait for services to be healthy | |
run: sleep 2 | |
- name: Run E2E tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config: pageLoadTimeout=100000,baseUrl=http://localhost:8089 | |
working-directory: test/ | |
# - name: Check if tests failed | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 | |
- 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 |