2021-01-06 15:37:59 -05:00
|
|
|
# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 15:50:07 -05:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-07-16 05:22:53 -04:00
|
|
|
name: e2e
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-08-15 10:17:06 -04:00
|
|
|
branches: [main]
|
2020-07-16 05:22:53 -04:00
|
|
|
pull_request:
|
2020-08-15 10:17:06 -04:00
|
|
|
branches: [main]
|
2020-07-16 05:22:53 -04:00
|
|
|
|
|
|
|
jobs:
|
2021-04-11 16:34:53 -04:00
|
|
|
build-frontend:
|
2020-08-19 16:43:56 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-11 16:34:53 -04:00
|
|
|
name: Build test build of frontend
|
2020-08-19 16:43:56 -04:00
|
|
|
steps:
|
2021-01-06 07:09:33 -05:00
|
|
|
- name: Check out repo
|
|
|
|
uses: actions/checkout@v2
|
2020-11-29 04:07:44 -05:00
|
|
|
|
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
- name: Cache build
|
2021-05-31 11:38:33 -04:00
|
|
|
uses: actions/cache@v2.1.6
|
2021-04-11 16:34:53 -04:00
|
|
|
with:
|
|
|
|
path: build
|
|
|
|
key: build
|
|
|
|
|
2020-08-19 16:43:56 -04:00
|
|
|
- name: Cache node_modules
|
2020-11-29 04:07:44 -05:00
|
|
|
uses: actions/cache@v2
|
|
|
|
id: yarn-cache
|
2020-08-19 16:43:56 -04:00
|
|
|
with:
|
2020-11-29 04:07:44 -05:00
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
2021-05-24 15:01:16 -04:00
|
|
|
key: ${{ runner.os }}-16-yarn-${{ hashFiles('**/yarn.lock') }}
|
2020-11-29 04:07:44 -05:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
|
|
|
|
- name: Set up NodeJS
|
2020-12-18 19:39:40 -05:00
|
|
|
uses: actions/setup-node@v2
|
2020-08-19 16:43:56 -04:00
|
|
|
with:
|
2021-05-24 15:01:16 -04:00
|
|
|
node-version: 16
|
2020-11-29 04:07:44 -05:00
|
|
|
|
2021-01-06 07:09:33 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install --frozen-lockfile --prefer-offline
|
2020-08-19 16:43:56 -04:00
|
|
|
|
2021-01-06 07:09:33 -05:00
|
|
|
- name: Build test production build
|
|
|
|
run: yarn build:test
|
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: build
|
2021-01-06 07:09:33 -05:00
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
end2end:
|
|
|
|
name: Perform E2E Test in ${{ matrix.browser }}
|
|
|
|
needs: build-frontend
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
browser: [ 'chrome', 'firefox' ]
|
|
|
|
steps:
|
|
|
|
- name: Check out repo
|
|
|
|
uses: actions/checkout@v2
|
2021-01-11 15:55:25 -05:00
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
- name: Download built frontend
|
|
|
|
uses: actions/download-artifact@master
|
2020-08-19 16:43:56 -04:00
|
|
|
with:
|
2021-04-11 16:34:53 -04:00
|
|
|
name: build
|
|
|
|
path: build
|
2021-01-06 07:09:33 -05:00
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
- uses: cypress-io/github-action@v2
|
2020-07-16 05:22:53 -04:00
|
|
|
with:
|
2021-04-11 16:34:53 -04:00
|
|
|
browser: ${{ matrix.browser }}
|
|
|
|
start: 'yarn serve:build'
|
2021-01-06 07:09:33 -05:00
|
|
|
|
2021-04-11 16:34:53 -04:00
|
|
|
- uses: actions/upload-artifact@master
|
|
|
|
if: always()
|
2020-11-15 14:07:02 -05:00
|
|
|
with:
|
2021-04-11 16:34:53 -04:00
|
|
|
name: screenshots
|
|
|
|
path: cypress/screenshots
|