Updated README for Lesson 7: Topic 5 assignment #8
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: CI | |
on: | |
push: | |
branches: | |
- feature/integrate-github-actions | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- test-type: 'api' | |
- test-type: 'e2e' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Cache Cypress binary | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-binary-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: cypress-${{ runner.os }}-binary- | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '21' | |
- name: Install dependencies | |
run: npm install | |
- name: Install Cypress binary | |
run: npm install cypress | |
- name: Verify Cypress binary | |
run: npx cypress verify | |
- name: Run API tests | |
if: ${{ matrix.test-type == 'api' }} | |
run: npx cypress run --spec "cypress/integration/api/**/*" | |
- name: Run e2e tests | |
if: ${{ matrix.test-type == 'e2e' }} | |
run: npx cypress run --spec "cypress/integration/e2e/**/*" |