This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
62 lines (62 loc) · 2.41 KB
/
quality-checks-e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "Smart Events UI :: Dev :: Quality Checks"
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
jobs:
run-all-checks:
runs-on: ubuntu-latest
if: github.repository == '5733d9e2be6485d52ffa08870cabdee0/sandbox-ui'
steps:
- uses: actions/checkout@v3.5.3
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Check labels
# Security due to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
if: ${{ !contains( github.event.pull_request.labels.*.name, 'safe to test') }}
run: |
echo "Please add the 'safe to test' label in order to run 'Smart Events UI :: E2E :: Quality Checks' pipeline if it's safe to test this code"
exit 1
- name: Add mask
run: |
echo "::add-mask::${{ secrets.CY_OPENSHIFT_OFFLINE_TOKEN }}"
echo "::add-mask::${{ secrets.CY_USER }}"
echo "::add-mask::${{ secrets.CY_PASSWORD }}"
- uses: actions/setup-node@v3
with:
node-version: "16"
cache: "npm"
- run: npm install
- run: npm run format:check
- run: npm run lint
- name: Set environment
run: |
sudo echo "127.0.0.1 prod.foo.redhat.com" | sudo tee -a /etc/hosts
echo "DEBUGENV=${{ secrets.CY_DEBUG_TEST }}" >> $GITHUB_ENV
echo $DEBUGENV
TOKEN=${{ secrets.CY_OPENSHIFT_OFFLINE_TOKEN }} ./scripts/get-sso-token.sh >> $GITHUB_ENV
- name: E2E tests
uses: cypress-io/github-action@v4
with:
install: false
project: ./cypress
start: npm run start
wait-on: "https://prod.foo.redhat.com:1337"
wait-on-timeout: 120
config-file: cypress.config.e2e.ts
env:
NODE_TLS_REJECT_UNAUTHORIZED: 0
CYPRESS_USER: ${{ secrets.CY_USER }}
CYPRESS_PASSWORD: ${{ secrets.CY_PASSWORD }}
CYPRESS_SANDBOX_DEV_REST_URL: ${{ secrets.CY_SANDBOX_DEV_REST_URL }}
CYPRESS_SANDBOX_DEV_REST_PATH: ${{ secrets.CY_SANDBOX_DEV_REST_PATH }}
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
if: always() && !cancelled()
with:
name: ui-artifacts
if-no-files-found: warn
path: |
**/*.log
**/cypress/screenshots/**
**/cypress/videos/**
**/cypress/target/surefire-reports/**