diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml new file mode 100644 index 00000000..56e6b519 --- /dev/null +++ b/.github/workflows/e2etest.yml @@ -0,0 +1,56 @@ +name: Cypress Tests + +on: + pull_request: + branches: + - main + paths-ignore: + - README.md + - CONTRIBUTING.md + - .gitignore + - frontend/components/admin/** + - frontend/components/kanban/** + - frontend/database/** + - frontend/mock/** + - frontend/**/*.yaml + +jobs: + prepare-install: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'pnpm' + cache-dependency-path: frontend/pnpm-lock.yaml + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + working-directory: frontend + start: pnpm run dev + wait-on: 'http://localhost:3000' + summary-title: 'Cypress Tests In Development' + publish-summary: true + + - name: Install junit-merge + run: pnpm add -g junit-merge + if: always() + + - name: Merge Cypress JUnit test results + run: junit-merge frontend/results/*.xml > frontend/results/merged-test-results.xml + if: always() + + - name: Upload merged test results as PR comment + uses: mikepenz/action-junit-report@v4 + if: always() + with: + report_paths: 'frontend/results/merged-test-results.xml' + github_token: ${{ secrets.PR_RW_TOKEN }} + check_name: 'Cypress Test Results' diff --git a/frontend/.gitignore b/frontend/.gitignore index 3878bd81..2ba642a6 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -8,6 +8,10 @@ # testing /coverage +# Ignore Cypress screenshots and results +frontend/cypress/screenshots/ +frontend/results/ + # next.js /.next/ /out/ diff --git a/frontend/cypress.config.ts b/frontend/cypress.config.ts index b906329b..b242ddb3 100644 --- a/frontend/cypress.config.ts +++ b/frontend/cypress.config.ts @@ -9,4 +9,5 @@ export default defineConfig({ // implement node event listeners here }, }, + projectId: "4k3nb1", });