generated from freeCodeCamp/template
-
-
Notifications
You must be signed in to change notification settings - Fork 40
77 lines (62 loc) · 2.52 KB
/
cypress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: CI - Cypress (e2e) tests
on:
push:
branches-ignore:
- renovate/**
pull_request:
jobs:
cypress-run:
name: E2E
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
browsers: [chrome, firefox]
languages: [english, chinese, espanol]
env:
BUILD_LANG: ${{ matrix.languages }}
CHINESE_GHOST_API_URL: ${{ secrets.CI_CHINESE_GHOST_API_URL }}
CHINESE_GHOST_API_VERSION: ${{ secrets.CI_CHINESE_GHOST_API_VERSION }}
CHINESE_GHOST_CONTENT_API_KEY: ${{ secrets.CI_CHINESE_GHOST_CONTENT_API_KEY }}
ESPANOL_GHOST_API_URL: ${{ secrets.CI_ESPANOL_GHOST_API_URL }}
ESPANOL_GHOST_API_VERSION: ${{ secrets.CI_ESPANOL_GHOST_API_VERSION }}
ESPANOL_GHOST_CONTENT_API_KEY: ${{ secrets.CI_ESPANOL_GHOST_CONTENT_API_KEY }}
HASHNODE_API_URL: api_url_from_hashnode_dashboard
ENGLISH_HASHNODE_HOST: host_from_hashnode_dashboard
ADS_ENABLED: true
GOOGLE_ADSENSE_DATA_AD_CLIENT: ca-pub-1234567890
GOOGLE_ADSENSE_DATA_AD_SLOT: 1234567890
POSTS_PER_PAGE: ${{ secrets.POSTS_PER_PAGE }}
SITE_DOMAIN: localhost:8080
LOCALE_FOR_UI: ${{ matrix.languages }}
LOCALE_FOR_GHOST: ${{ matrix.languages }}
steps:
# Remove this step after firefox launches 106 (hopefully it's fixed by then)
- name: Downgrade Firefox
run: |
curl https://ftp.mozilla.org/pub/firefox/releases/103.0/linux-x86_64/en-US/firefox-103.0.tar.bz2 --output firefox-103.0.tar.bz2
tar -xjf firefox-103.0.tar.bz2
sudo mv firefox /opt/
sudo mv /usr/bin/firefox /usr/bin/firefox_old
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
- name: Checkout source files
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Start Ghost containers
run: npm run start:containers
- name: Start CI server and run Cypress
uses: cypress-io/github-action@v6
with:
start: npm run start:ci:${{ matrix.languages }}
wait-on: http://localhost:8080
wait-on-timeout: 1200
browser: ${{ matrix.browsers }}
headless: true
spec: cypress/e2e/${{ matrix.languages }}/**/*
- name: Stop Ghost containers
run: npm run stop:containers