Skip to content

Instantly share code, notes, and snippets.

@MichaelrMentele
Created December 24, 2022 00:41
Show Gist options
  • Save MichaelrMentele/d0b1607051500dcee5ba1a4ddde6e8fc to your computer and use it in GitHub Desktop.
Save MichaelrMentele/d0b1607051500dcee5ba1a4ddde6e8fc to your computer and use it in GitHub Desktop.
```yaml
e2e-tests:
runs-on: 'ubuntu-latest'
strategy:
fail-fast: false
matrix:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving Cypress Cloud hanging ...
# https://github.com/cypress-io/github-action/issues/48
# run copies of the current job in parallel
containers: [1, 2, 3, 4, 5]
environment: CI
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
FAKE_AUTH: 'true'
GROWTHBOOK_API_KEY: ${{ secrets.GROWTHBOOK_API_KEY }}
DISABLE_THIRD_PARTY_APIS: 'true'
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/leftlane_app_dev?statement_cache_size=0
steps:
- name: Checkout
uses: actions/checkout@v3
# We should really be reusing an image built above instead
# of rebuilding and re-installing over and over
- name: Setup node
uses: actions/setup-node@v3
- name: yarn install
run: yarn install --immutable
- name: Build packages
run: yarn build-packages
- name: setup db
run: SEEDING=true yarn resetdb
- name: E2E Tests
uses: cypress-io/github-action@v5
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
install: false
env: true
wait-on: 'http://localhost:8910'
wait-on-timeout: 120
record: true
parallel: true
group: 'UI - Chrome'
browser: chrome
build: yarn rw build
start: yarn rw serve
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment