mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: Cypress
|
|
|
|
# Controls when the action will run.
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
env:
|
|
LANG: "de_DE.UTF-8"
|
|
|
|
jobs:
|
|
# Label of the container job
|
|
runner-job:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
config: ["desktop", "mobile"]
|
|
|
|
# Containers must run in Linux based operating systems
|
|
runs-on: ubuntu-latest
|
|
|
|
# Service containers to run with `container-job`
|
|
services:
|
|
# Label used to access the service container
|
|
postgres:
|
|
# Docker Hub image
|
|
image: mdillon/postgis
|
|
# Provide the password for postgres
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: gsevpt_tests
|
|
# Set health checks to wait until postgres has started
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
# Maps tcp port 5432 on service container to the host
|
|
- 5432:5432
|
|
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.8"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
|
|
- name: Start server
|
|
run: |
|
|
flask test create-all
|
|
flask test seed
|
|
gunicorn -b 127.0.0.1:5001 -w 1 project:app --daemon
|
|
env:
|
|
DATABASE_URL: postgresql://postgres:postgres@localhost/gsevpt_tests
|
|
TESTING: 1
|
|
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v2
|
|
with:
|
|
record: true
|
|
wait-on: "http://127.0.0.1:5001"
|
|
config-file: cypress/config/${{ matrix.config }}.json
|
|
config: baseUrl=http://127.0.0.1:5001
|
|
env:
|
|
DATABASE_URL: postgresql://postgres:postgres@localhost/gsevpt_tests
|
|
TESTING: 1
|
|
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|