mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-09-20 07:59:03 -04:00
62ece767e1
Okay I'm just done. Firefox in our current CI is just the WORST. It is slower than chrome and crashes A LOT! Like really! The e2e workflows of some PRs have to run 4 or 5 times because firefox decides to just lose the connection. This may also be caused by the performance of GHA, but right now it's easier to (temporally) remove firefox than switching to a whole new CI. Just to be clear: I know that this step isn't optimal. I know that a huge part of our community uses firefox. But right now the flakiness of the firefox CI runs drives me crazy! At the moment we need the e2e tests just for our development to make sure that we don't accidentally break something. We can re-add firefox again when it's stable to use. Or when we have shifted enough of the e2e tests to jest. It would be nice to test other browsers (like safari or edge) as well. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
105 lines
2.9 KiB
YAML
105 lines
2.9 KiB
YAML
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
name: e2e
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build-frontend:
|
|
runs-on: ubuntu-latest
|
|
name: Build test build of frontend
|
|
steps:
|
|
- name: Check out repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Cache build
|
|
uses: actions/cache@v3.0.1
|
|
id: build-cache
|
|
with:
|
|
path: .next
|
|
key: build-${{ github.sha }}
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
|
|
- name: Cache yarn cache
|
|
uses: actions/cache@v3
|
|
id: yarn-cache
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Set up NodeJS
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: Install dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: yarn install --immutable
|
|
|
|
- name: Build test production build
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: yarn build:test
|
|
|
|
- uses: actions/upload-artifact@master
|
|
with:
|
|
name: next-build
|
|
path: |
|
|
.next
|
|
!.next/cache
|
|
|
|
end2end:
|
|
name: Perform E2E Test in ${{ matrix.browser }}
|
|
needs: build-frontend
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
# renovate: datasource=docker depName=cypress/browsers versioning=docker
|
|
image: cypress/browsers:node16.13.2-chrome97-ff96
|
|
options: --user 1001 --shm-size=2g
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
browser: [ 'chrome' ]
|
|
containers: [ 1, 2, 3, 4, 5 ]
|
|
steps:
|
|
- name: Check out repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Download built frontend
|
|
uses: actions/download-artifact@master
|
|
with:
|
|
name: next-build
|
|
path: .next
|
|
|
|
- uses: cypress-io/github-action@v2
|
|
with:
|
|
browser: ${{ matrix.browser }}
|
|
start: 'yarn start:ci'
|
|
parallel: true
|
|
record: true
|
|
group: "UI - ${{ matrix.browser }}"
|
|
wait-on: 'http://127.0.0.1:3001/'
|
|
wait-on-timeout: 120
|
|
install-command: yarn install --immutable --silent
|
|
env:
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: actions/upload-artifact@master
|
|
if: always()
|
|
with:
|
|
name: screenshots
|
|
path: cypress/screenshots
|