Move Percy CI to separate workflow

That workflow is now triggered by pull request reviews being submitted.
It is conditionally checked that the PR review is approving.
This commit is contained in:
Tibor Leupold 2023-01-27 14:19:51 -08:00
Родитель dc9b173caf
Коммит 8c3a5110db
2 изменённых файлов: 72 добавлений и 66 удалений

66
.github/workflows/continous-integration.yml поставляемый
Просмотреть файл

@ -113,72 +113,6 @@ jobs:
run: coveralls
continue-on-error: true
test_percy:
name: Percy CI
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:13.2
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: network
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
ALLOWED_HOSTS: 127.0.0.1,localhost,mozfest.localhost,default-site.com,secondary-site.com
CONTENT_TYPE_NO_SNIFF: True
CORS_ALLOWED_ORIGINS: "*"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/network
DEBUG: True
DJANGO_SECRET_KEY: secret
DOMAIN_REDIRECT_MIDDLEWARE_ENABLED: False
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETWORK_SITE_URL: https://foundation.mozilla.org
PIPENV_VERBOSITY: -1
PULSE_API_DOMAIN: https://network-pulse-api-production.herokuapp.com
PULSE_DOMAIN: https://www.mozillapulse.org
RANDOM_SEED: 530910203
SET_HSTS: False
SSL_REDIRECT: False
TARGET_DOMAINS: foundation.mozilla.org
USE_S3: False
X_FRAME_OPTIONS: DENY
XSS_PROTECTION: True
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9.9
cache: "pip"
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install Python Dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
- name: Install Node Dependencies
run: npm ci
- name: Install additional tooling
run: |
sudo apt-get update
sudo apt-get install -y gettext libgconf-2-4
- name: Install Playwright
run: npm run playwright:install
- name: Preroll
run: |
npm run build
python network-api/manage.py collectstatic --no-input --verbosity 0
python network-api/manage.py migrate --no-input
python network-api/manage.py block_inventory
python network-api/manage.py load_fake_data
- name: Percy Test
run: npm run percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
test_integration:
name: Integration testing
runs-on: ubuntu-20.04

72
.github/workflows/visual-regression-testing.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,72 @@
name: Visual Regression Testing
on:
pull_request_review:
types: [submitted]
jobs:
approved:
name: Percy CI
if: github.event.review.state == 'approved'
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:13.2
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: network
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
ALLOWED_HOSTS: 127.0.0.1,localhost,mozfest.localhost,default-site.com,secondary-site.com
CONTENT_TYPE_NO_SNIFF: True
CORS_ALLOWED_ORIGINS: "*"
DATABASE_URL: postgres://postgres:postgres@localhost:5432/network
DEBUG: True
DJANGO_SECRET_KEY: secret
DOMAIN_REDIRECT_MIDDLEWARE_ENABLED: False
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETWORK_SITE_URL: https://foundation.mozilla.org
PIPENV_VERBOSITY: -1
PULSE_API_DOMAIN: https://network-pulse-api-production.herokuapp.com
PULSE_DOMAIN: https://www.mozillapulse.org
RANDOM_SEED: 530910203
SET_HSTS: False
SSL_REDIRECT: False
TARGET_DOMAINS: foundation.mozilla.org
USE_S3: False
X_FRAME_OPTIONS: DENY
XSS_PROTECTION: True
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9.9
cache: "pip"
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install Python Dependencies
run: pip install -r requirements.txt -r dev-requirements.txt
- name: Install Node Dependencies
run: npm ci
- name: Install additional tooling
run: |
sudo apt-get update
sudo apt-get install -y gettext libgconf-2-4
- name: Install Playwright
run: npm run playwright:install
- name: Preroll
run: |
npm run build
python network-api/manage.py collectstatic --no-input --verbosity 0
python network-api/manage.py migrate --no-input
python network-api/manage.py block_inventory
python network-api/manage.py load_fake_data
- name: Percy Test
run: npm run percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}