mirror of
https://github.com/ruisaraiva19/favycon.git
synced 2026-09-12 19:51:07 +05:00
* feat: upgrade dependencies * chore: update linter and CI workflows * chore: upgrade browserslist
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
name: Tests
|
|
|
|
on: pull_request
|
|
|
|
jobs:
|
|
test_e2e:
|
|
name: Run Cypress
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'yarn'
|
|
|
|
- name: Install dependencies
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Cache Next.js build cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ${{ github.workspace }}/.next/cache
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
- name: Build static assets
|
|
run: yarn build
|
|
|
|
- name: Run Cypress
|
|
uses: cypress-io/github-action@v2
|
|
with:
|
|
start: npm start
|
|
wait-on: http://localhost:3000
|
|
# after the test run completes
|
|
# store videos and any screenshots
|
|
# NOTE: screenshots will be generated only if E2E test failed
|
|
# thus we store screenshots only on failures
|
|
- 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
|