mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-19 10:01:25 -04:00
73 lines
2.1 KiB
YAML
73 lines
2.1 KiB
YAML
name: CI - E2E - 3rd party donation tests
|
|
|
|
# These are only run on prod-* branches to test the 3rd party donation flow
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'prod-**'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
jobs:
|
|
do-everything:
|
|
name: Build & Test
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x]
|
|
services:
|
|
mongodb:
|
|
image: mongo:4.4
|
|
ports:
|
|
- 27017:27017
|
|
# We need mailhog to catch any emails the api tries to send.
|
|
mailhog:
|
|
image: mailhog/mailhog
|
|
ports:
|
|
- 1025:1025
|
|
|
|
steps:
|
|
- name: Checkout Source Files
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
|
|
|
- name: Checkout client-config
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
|
with:
|
|
repository: freeCodeCamp/client-config
|
|
path: client-config
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Set freeCodeCamp Environment Variables
|
|
run: |
|
|
sed '/STRIPE/d; /PAYPAL/d;' sample.env > .env
|
|
echo 'STRIPE_PUBLIC_KEY=${{ secrets.STRIPE_PUBLIC_KEY }}' >> .env
|
|
echo 'STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }}' >> .env
|
|
echo 'PAYPAL_CLIENT_ID=${{ secrets.PAYPAL_CLIENT_ID }}' >> .env
|
|
echo 'PAYPAL_SECRET=${{ secrets.PAYPAL_SECRET }}' >> .env
|
|
|
|
- name: Install and Build
|
|
run: |
|
|
npm ci
|
|
npm run build
|
|
- name: Seed Database
|
|
run: npm run seed
|
|
- name: Move serve.json to Public Folder
|
|
run: cp client-config/serve.json client/public/serve.json
|
|
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v4
|
|
with:
|
|
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
|
|
start: npm run start-ci
|
|
wait-on: http://localhost:8000
|
|
wait-on-timeout: 1200
|
|
config: baseUrl=http://localhost:8000
|
|
browser: chrome
|
|
|
|
spec: cypress/e2e/third-party/*.{js,ts}
|