functional #4258
Workflow file for this run
This file contains 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: functional | |
on: | |
pull_request: | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cypress: | |
runs-on: ubuntu-latest | |
env: | |
PGDATABASE: cfgov | |
PGUSER: cfpb | |
PGPASSWORD: cfpb | |
POSTGRES_USER: cfpb | |
PGHOST: localhost | |
PGPORT: 5432 | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
DJANGO_ADMIN_USERNAME: admin | |
DJANGO_ADMIN_PASSWORD: admin | |
services: | |
elasticsearch: | |
image: elasticsearch:7.10.1 | |
ports: | |
- 9200:9200 | |
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10 | |
postgres: | |
image: postgres:13 | |
env: | |
POSTGRES_USER: cfpb | |
POSTGRES_PASSWORD: cfpb | |
POSTGRES_DB: cfgov | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements/local.txt | |
- name: Set up initial data | |
run: ./refresh-data.sh test.sql.gz | |
- name: Run Cypress | |
uses: cypress-io/github-action@v5 | |
with: | |
build: yarn build | |
start: python cfgov/manage.py runserver 0.0.0.0:8000 | |
wait-on: 'http://localhost:8000' | |
env: | |
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }} | |
CYPRESS_ENVIRONMENT: github | |
- name: Store any Cypress failure screenshots | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress_failure_screenshots | |
path: ./test/cypress/screenshots/ | |
retention-days: 1 |