Update gatsby-config.js #147
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
# This is a basic workflow to help you get started with Actions | |
name: Tests Integration | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
Tests: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
- name: Cache node modules | |
id: cache-nodemodules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install modules | |
if: steps.cache-nodemodules.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: Run unit tests | |
run: yarn test:text | |
- name: Run e2e tests | |
uses: cypress-io/github-action@v2 | |
timeout-minutes: 10 | |
with: | |
install: true | |
install-command: yarn | |
build: yarn build | |
start: yarn serve -p 8000 | |
wait-on: 'http://localhost:8000' | |
browser: chrome | |
headless: false | |
config-file: cypress.config.ts | |
- uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
# Test run video was always captured, so this action uses "always()" condition | |
- uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: cypress-videos | |
path: cypress/videos |