Skip to content

Commit

Permalink
use Cypress binary from cache if found, else install cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
aasimsyed committed Apr 20, 2024
1 parent 8f945d2 commit ce99509
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ jobs:
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:
Expand All @@ -27,6 +34,16 @@ jobs:
- name: Install dependencies
run: npm install

- name: Check Cypress binary
run: |
if [ ! -f $(npm bin)/cypress ]; then
echo "Cypress binary not found. Installing..."
npx cypress install
fi
- 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/**/*"
Expand Down

0 comments on commit ce99509

Please sign in to comment.