fix: setup bun #3
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: Cypress single tests | |
on: [push, workflow_dispatch] | |
jobs: | |
test1: | |
name: Cypress test | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
# install a specific version of Node using | |
# https://github.com/actions/setup-node | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# Restore the previous npm modules and Cypress binary archives. | |
# In case there's no previous cache the packages will be downloaded | |
# and saved automatically after the entire workflow successfully finishes. | |
# See https://github.com/actions/cache | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-node-${{ hashFiles('**/bun.lockb') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('**/bun.lockb') }} | |
- name: install dependencies and verify Cypress | |
env: | |
# make sure every Cypress install prints minimal information | |
CI: 1 | |
# print Cypress and OS info | |
run: | | |
bun install | |
bunx cypress verify | |
bunx cypress info | |
bunx cypress version | |
bunx cypress version --component package | |
bunx cypress version --component binary | |
bunx cypress version --component electron | |
bunx cypress version --component node | |
# Starts local server, then runs Cypress tests and records results on Cypress Cloud | |
- name: Cypress tests | |
run: bun run test | |
env: | |
TERM: xterm | |
# Save screenshots as test artifacts | |
# https://github.com/actions/upload-artifact | |
- uses: | |
actions/upload-artifact@v4 | |
# there might be no screenshots created when: | |
# - there are no test failures | |
# so only upload screenshots if previous step has failed | |
if: failure() | |
with: | |
name: screenshots | |
path: cypress/screenshots |