e2e suite #12
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: e2e suite | |
on: | |
workflow_dispatch: | |
schedule: | |
# At 2:00 AM UTC on Monday, Wednesday, and Friday | |
- cron: "00 2 * * 1,3,5" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- "**.py" | |
- Dockerfile | |
- "saleor/**" | |
- ".github/workflows/e2e.yml" | |
- pyproject.toml | |
- poetry.lock | |
env: | |
DATABASE_URL: "postgres://saleor:saleor@postgres:5432/saleor" | |
SECRET_KEY: ci-test | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
container: python:3.9 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: saleor | |
POSTGRES_USER: saleor | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
apt-get install -y libpq-dev | |
- name: Install and configure poetry | |
run: | | |
pip install poetry==1.7.0 | |
- name: Cache the venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry/virtualenvs | |
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: | | |
poetry env use python3.9 | |
poetry install --no-root | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
- name: Add Python Virtual Environment to PATH | |
run: | | |
# Note: requires `poetry env use` to be ran, otherwise poetry | |
# may not be able to find which virtual environment is in use. | |
# Ticket: https://github.com/python-poetry/poetry/issues/7190 | |
echo "$(poetry env info -p)"/bin >> $GITHUB_PATH | |
- name: Run E2E tests | |
run: | | |
pytest -m "e2e" --junit-xml=e2e-test-results.xml | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/pytest-results-action@4c22f3314dfc484aaad53353d3dd8dddf5de6b46 # v0.5.0 | |
with: | |
path: e2e-test-results.xml | |
summary: true | |
display-options: fEX | |
fail-on-empty: true | |
title: E2E core test results |