-
Notifications
You must be signed in to change notification settings - Fork 38
137 lines (135 loc) · 4.04 KB
/
pull-request.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Pull request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- master
- releases/*
env:
NODE_OPTIONS: '--max-old-space-size=8192'
# See https://github.com/cypress-io/cypress/issues/25357
ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu
jobs:
preflight-check:
# Prevents running the workflow when a PR is marked as draft.
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check if PR is draft
id: check
run: |
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then
skip=true
else
skip=false
fi
echo "skip=${skip}" >> $GITHUB_OUTPUT
echo "skip=${skip}"
lint:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn build:all
- run: yarn lint:all
format:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn build:all
- run: yarn format:all
circular-deps:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn build:all
- run: yarn check:circular_deps:all
unit-tests:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn build:all
- run: yarn test:unit
translation-files:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- run: yarn install --immutable
- run: yarn build:all
- run: yarn workspace @openshift-assisted/locales run validate_translation_files
tests:
needs: preflight-check
if: needs.preflight-check.outputs.skip == 'false'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODEJS_VERSION }}
cache: yarn
- name: Create env file for assisted-ui
run: echo "AIUI_APP_API_URL=http://127.0.0.1:4173" >> apps/assisted-ui/.env.local
- name: Run integration tests
uses: cypress-io/github-action@v6
with:
install-command: yarn install --immutable
config-file: cypress.config.ts
browser: chrome
build: yarn build:all
start: yarn preview:assisted-ui --host 127.0.0.1
working-directory: libs/ui-lib-tests
wait-on: 'http://127.0.0.1:4173'
- name: Store test execution screenshots on failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: libs/ui-lib-tests/cypress/screenshots
- name: Store test execution video
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: libs/ui-lib-tests/cypress/videos