Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
Update cypress.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmadHashems committed Apr 1, 2022
1 parent 6b33aff commit 60e5da5
Showing 1 changed file with 68 additions and 57 deletions.
125 changes: 68 additions & 57 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,80 @@
name: Cypress Tests

- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
#
# - name: Cache node modules
# uses: actions/cache@v1
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
#
# - name: Cache Cypress binary
# uses: actions/cache@v1
# with:
# path: ~/.cache/Cypress
# key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
# restore-keys: |
# cypress-${{ runner.os }}-cypress-
#
# - name: Cache firebase emulators
# uses: actions/cache@v2
# with:
# path: ~/.cache/firebase/emulators
# key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}
on: [pull_request]

- run: npm ci
- run: npm run build --if-present
# - run: npm test -- --coverage
jobs:
cypress-run:
runs-on: ubuntu-latest

- name: Save build folder
uses: actions/upload-artifact@v2
with:
name: build
if-no-files-found: error
path: build
strategy:
matrix:
node-version: [16.x]

# uncomment to use the saved build
# - name: Download the build folders
# uses: actions/download-artifact@v2
# with:
# name: build
# path: build
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
#
# - name: Cache node modules
# uses: actions/cache@v1
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
#
# - name: Cache Cypress binary
# uses: actions/cache@v1
# with:
# path: ~/.cache/Cypress
# key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
# restore-keys: |
# cypress-${{ runner.os }}-cypress-
#
# - name: Cache firebase emulators
# uses: actions/cache@v2
# with:
# path: ~/.cache/firebase/emulators
# key: ${{ runner.os }}-firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}

- name: Install Firebase Emulator Suite
run: |
npm install -g firebase-tools
npm ci
npm run build
working-directory: functions
- run: npm ci
- run: npm run build --if-present
# - run: npm test -- --coverage

- name: Save build folder
uses: actions/upload-artifact@v2
with:
name: build
if-no-files-found: error
path: build

# uncomment to use the saved build
# - name: Download the build folders
# uses: actions/download-artifact@v2
# with:
# name: build
# path: build

- name: Update browsers
run: npx browserslist@latest --update-db
- name: Install Firebase Emulator Suite
run: |
npm install -g firebase-tools
npm ci
npm run build
working-directory: functions

- name: Cypress run
uses: cypress-io/github-action@v2
with:
- name: Update browsers
run: npx browserslist@latest --update-db

- name: Cypress run
uses: cypress-io/github-action@v2
with:
browser: chrome
wait-on: 'http://localhost:8080'
start: npm run start:emulator
env:
env:
# Authorization for running the firebase CLI (emulator)
FIREBASE_TOKEN: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SOEN_390_BA781 }}

Expand All @@ -80,7 +91,7 @@
CYPRESS_PATIENT_EMAIL: ${{ secrets.CYPRESS_PATIENT_EMAIL }}
CYPRESS_PATIENT_PASSWORD: ${{ secrets.CYPRESS_PATIENT_PASSWORD }}

# uncomment to record and save the cypress run on the repo
# uncomment to record and save the cypress run on the repo
# - uses: actions/upload-artifact@master
# with:
# name: screenshots
Expand All @@ -93,4 +104,4 @@
# - uses: actions/upload-artifact@master
# with:
# name: videos
# path: cypress/videos
# path: cypress/videos

0 comments on commit 60e5da5

Please sign in to comment.