refactor: remove e2e tests from main branch CI

E2E tests now only run before production deploys for faster feedback:
- test.yaml (main branch): ExUnit, formatting, Credo only
- staging.yaml (main branch): Immediate Dokku deploy
- production.yaml (production branch): Full test suite including e2e

This allows staging to deploy quickly while ensuring production
has comprehensive test coverage including browser automation.
This commit is contained in:
Graham McIntire 2026-03-07 12:44:23 -06:00
parent 40b3ea87f2
commit d52ab0eceb
No known key found for this signature in database

View file

@ -82,109 +82,3 @@ jobs:
name: coverage-report
path: cover/
retention-days: 7
test-e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: test-exunit
services:
postgres:
image: timescale/timescaledb:latest-pg16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: towerops_dev
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: https://github.com/actions/checkout@v4
- name: Set up Elixir
uses: https://github.com/erlef/setup-beam@v1
with:
version-type: strict
elixir-version: '1.18.1'
otp-version: '27.2'
- name: Set up Node.js
uses: https://github.com/actions/setup-node@v4
with:
node-version: '20'
- name: Cache deps
uses: https://github.com/actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-deps-${{ hashFiles('mix.lock') }}
restore-keys: ${{ runner.os }}-deps-
- name: Cache _build
uses: https://github.com/actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-build-${{ hashFiles('lib/**/*.ex') }}-${{ hashFiles('mix.lock') }}
restore-keys: ${{ runner.os }}-build-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y openssl libssl1.1 libssl-dev libsnmp-dev snmp-mibs-downloader postgresql-client
- name: Install Elixir dependencies
run: mix deps.get
env:
MIX_ENV: dev
- name: Setup database
run: mix ecto.setup
env:
MIX_ENV: dev
DATABASE_HOST: postgres
DATABASE_PORT: 5432
- name: Start Phoenix server in background
run: mix phx.server &
env:
MIX_ENV: dev
DATABASE_HOST: postgres
DATABASE_PORT: 5432
SECRET_KEY_BASE: dev_secret_key_base_for_testing_only_min_64_chars_required_here
PHX_HOST: localhost
- name: Wait for Phoenix to start
run: |
timeout 60 bash -c 'until curl -f http://localhost:4000/health; do sleep 2; done'
- name: Install Playwright dependencies
working-directory: e2e
run: |
npm ci
npx playwright install --with-deps
- name: Run e2e tests
working-directory: e2e
run: npm test
env:
CI: true
- name: Upload test results
if: failure()
uses: https://github.com/actions/upload-artifact@v4
with:
name: playwright-report
path: e2e/playwright-report/
retention-days: 7
- name: Upload screenshots on failure
if: failure()
uses: https://github.com/actions/upload-artifact@v4
with:
name: playwright-screenshots
path: e2e/test-results/
retention-days: 7