diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbfefd8..111b85c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,30 +6,28 @@ on: types: [ opened, synchronize, reopened ] jobs: - build: + cypress-run: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - name: Install dependencies run: npm install - name: Start Vite server - run: npm run dev:expose & + run: npm run dev & + env: + CI: true - - name: Cypress run - uses: cypress-io/github-action@v6 + - name: Wait for Vite server to start + uses: jakejarvis/wait-action@v1 + with: + url: 'http://localhost:5173/retroleaderboards' + timeout: 60 - # - name: Run Cypress tests - # env: - # BASE_URL: http://localhost:5173/retroleaderboards - # run: npm run cy:run + - name: Run Cypress tests + uses: cypress-io/github-action@v6 + with: + browser: chrome diff --git a/cypress.config.ts b/cypress.config.ts index 32c2c5a..e097ea8 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from "cypress"; export default defineConfig({ e2e: { - baseUrl: process.env.BASE_URL || 'http://localhost:5173/retroleaderboards', + baseUrl: 'http://localhost:5173/retroleaderboards', setupNodeEvents(on, config) { // implement node event listeners here }, diff --git a/vite.config.ts b/vite.config.ts index 7e2b4ed..fc0b624 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,4 +5,8 @@ import vue from '@vitejs/plugin-vue' export default defineConfig({ base: '/retroleaderboards/', plugins: [vue()], + server: { + host: '0.0.0.0', + port: 5173, + }, })