Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: set up cypress #41

Merged
merged 1 commit into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/lint.yaml → .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: lint
on:
push:
name: e2e
on:
pull_request:

jobs:
lint:
# TODO: share setup action between test and e2e
e2e:
runs-on: ubuntu-latest
container: cypress/browsers:node18.12.0-chrome107
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,7 +21,7 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8.x.x

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
Expand All @@ -37,5 +39,14 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Check linter
run: pnpm lint:check
- name: Build core
working-directory: packages/core
run: pnpm build

- name: Cypress run
uses: cypress-io/github-action@v5
with:
browser: chrome
build: echo "Start runs build"
command: pnpm --filter viewer run cy:run
start: pnpm --filter viewer run dev
6 changes: 5 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8.x.x

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
Expand All @@ -37,6 +37,9 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Check linter
run: pnpm lint:check

- name: Build core
working-directory: packages/core
run: pnpm build
Expand All @@ -46,3 +49,4 @@ jobs:

- name: Run all tests
run: pnpm --recursive run test:cov

11 changes: 11 additions & 0 deletions packages/viewer/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from 'cypress'

export default defineConfig({
projectId: '7u7evp',
chromeWebSecurity: false,
e2e: {
baseUrl: 'http://localhost:5173',
specPattern: 'cypress/e2e/**/*.{ts,tsx}',
supportFile: false,
},
})
5 changes: 0 additions & 5 deletions packages/viewer/cypress.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
describe('with a working remote', () => {
// FIXME: unskip
describe.skip('with a working remote', () => {
beforeEach(() => {
cy.intercept({ hostname: /pi-base-bundles/ }, { fixture: 'main.min.json' })
})
Expand Down
Empty file.
6 changes: 1 addition & 5 deletions packages/viewer/cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "es2015",
"lib": [
"es5",
"dom"
],
"types": [
"cypress"
],
Expand Down
Empty file.