Skip to content

Tests (DoltHub/DoltLab Prod) #21078

Tests (DoltHub/DoltLab Prod)

Tests (DoltHub/DoltLab Prod) #21078

Workflow file for this run

name: Tests (DoltHub/DoltLab Prod)
on:
workflow_dispatch:
inputs:
tags:
description: "Ignore me"
required: false
type: boolean
schedule:
# run every hour during business hours (UTC time)
- cron: "0 0,16-23 * * 1-5"
# run every 3 hours outside of business hours
- cron: "0 1-15/3 * * 1-5"
# run every 3 hours on weekends
- cron: "0 */3 * * 6,0"
pull_request:
branches:
- main
concurrency:
group: tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "18"
- name: configure aws credentials # used for publishing sns messages after test run failures
uses: aws-actions/[email protected]
if: ${{ github.event_name == 'schedule' }}
with:
role-to-assume: ${{ secrets.ROLE_TO_ASSUME }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: "us-west-2"
- name: Install dependencies
run: yarn
- name: Cypress run dolthub tests
id: dolthub-tests
uses: cypress-io/github-action@v6
with:
install: false
browser: chrome
env:
CYPRESS_TEST_USERNAME: ${{ secrets.CYPRESS_TEST_USERNAME }}
CYPRESS_TEST_PASSWORD: ${{ secrets.CYPRESS_TEST_PASSWORD }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
AWS_REGION: "us-west-2"
SNS_TOPIC_ARN: ${{ secrets.SNS_TOPIC_ARN }}
ALERT_ON_FAILURE: ${{ github.event_name == 'schedule' }}
- name: Cypress run doltlab tests
uses: cypress-io/github-action@v6
if: steps.dolthub-tests.outcome == 'success' || steps.dolthub-tests.outcome == 'failure'
with:
install: false
browser: chrome
config-file: cypress.doltlab.config.ts
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
- name: Save screenshots of failed tests
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
retention-days: 7
- name: Echo current time
if: failure()
run: |
echo "Current run time: $(date)"