Run Tests On Push/Schedule #29
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: Run Tests On Push/Schedule | |
concurrency: UI_TESTS | |
env: | |
USER_1: ${{ secrets.USER_1 }} | |
USER_2: ${{ secrets.USER_2 }} | |
USER_3: ${{ secrets.USER_3 }} | |
USER_4: ${{ secrets.USER_4 }} | |
CLIENT_ID: ${{ secrets.REACT_APP_CLIENT_ID }} | |
CY_TEST_FAIL_ON_MANAGED: 1 | |
on: | |
schedule: | |
- cron: "0 13 * * 1-5" | |
push: | |
branches: | |
- develop | |
- staging | |
- master | |
jobs: | |
run-cypress-e2e: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
user: ["USER_1", "USER_2", "USER_3", "USER_4"] | |
steps: | |
- name: install command line utilities | |
run: sudo apt-get install -y expect | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18.14" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
~/.cache/Cypress | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
- run: | | |
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_RECORD_KEY }}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | |
- run: echo "MANAGER_OAUTH=$USER_1" >> ./packages/manager/.env | |
if: matrix['user'] == 'USER_1' | |
- run: echo "MANAGER_OAUTH=$USER_2" >> ./packages/manager/.env | |
if: matrix['user'] == 'USER_2' | |
- run: echo "MANAGER_OAUTH=$USER_3" >> ./packages/manager/.env | |
if: matrix['user'] == 'USER_3' | |
- run: echo "MANAGER_OAUTH=$USER_4" >> ./packages/manager/.env | |
if: matrix['user'] == 'USER_4' | |
- run: | | |
echo "REACT_APP_LAUNCH_DARKLY_ID=${{ secrets.REACT_APP_LAUNCH_DARKLY_ID }}" >> ./packages/manager/.env | |
echo "REACT_APP_CLIENT_ID=$CLIENT_ID" >> ./packages/manager/.env | |
echo "REACT_APP_LOGIN_ROOT=${{ secrets.REACT_APP_LOGIN_ROOT }}" >> ./packages/manager/.env | |
echo "REACT_APP_API_ROOT=${{ secrets.REACT_APP_API_ROOT }}" >> ./packages/manager/.env | |
echo "REACT_APP_APP_ROOT=${{ secrets.REACT_APP_APP_ROOT }}" >> ./packages/manager/.env | |
echo "REACT_APP_DISABLE_NEW_RELIC=1" >> ./packages/manager/.env | |
yarn install:all | |
yarn build | |
yarn start:manager:ci & | |
- name: Run tests | |
uses: cypress-io/github-action@v5 | |
with: | |
working-directory: packages/manager | |
wait-on: "http://localhost:3000" | |
wait-on-timeout: 1000 | |
install: false | |
browser: chrome | |
record: true | |
parallel: true |