chore(deps): update dependency eslint to v9 #1159
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 UI tests | |
on: | |
push: | |
branches: | |
- main | |
merge_group: | |
pull_request: | |
jobs: | |
cypress-run: | |
concurrency: cypress-${{ github.head_ref || github.ref }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Yarn Install and Cache | |
uses: graasp/graasp-deploy/.github/actions/yarn-install-and-cache@v1 | |
with: | |
cypress: true | |
- name: Build App | |
run: yarn build:test | |
shell: bash | |
env: | |
VITE_PORT: 3000 | |
VITE_API_HOST: http://localhost:3636 | |
VITE_GRAASP_APP_KEY: id-1234567890 | |
VITE_ENABLE_MOCK_API: true | |
VITE_VERSION: cypress-tests | |
- name: Cypress Run | |
uses: cypress-io/github-action@v5 | |
env: | |
VITE_PORT: 3000 | |
VITE_API_HOST: http://localhost:3636 | |
VITE_GRAASP_APP_KEY: id-1234567890 | |
VITE_ENABLE_MOCK_API: true | |
VITE_VERSION: cypress-tests | |
with: | |
install: false | |
config: baseUrl=http://localhost:3000 | |
start: yarn preview:test | |
browser: chrome | |
quiet: true | |
# point to new cypress@10 config file | |
config-file: cypress.config.ts | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
- name: coverage report | |
run: npx nyc report --reporter=text-summary | |
- name: coverage commit status | |
run: | | |
total=$(cat coverage/coverage-summary.json | jq .total.lines.pct) | |
echo Total coverage ${total} | |
curl -S -s \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${GITHUB_TOKEN}" \ | |
https://api.github.com/repos/${REPO_PATH}/statuses/${COMMIT_SHA} \ | |
-d "{\"state\":\"success\",\"target_url\":\"https://github.com/${REPO_PATH}/actions/runs/${RUN_ID}\",\"description\":\"${total}%\",\"context\":\"code-coverage\"}" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
REPO_PATH: ${{ github.repository }} | |
COMMIT_SHA: ${{ github.sha }} | |
RUN_ID: ${{ github.run_id }} |