-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (71 loc) · 1.99 KB
/
pull-request.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Pull request
on:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
cypress:
timeout-minutes: 30
runs-on: ubuntu-22.04
name: Cypress tests
container:
image: cypress/browsers:node16.16.0-chrome107-ff107
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
- name: Install dependencies
run: npm ci
- uses: sibiraj-s/action-eslint@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
eslint-args: '--quiet'
extensions: 'html,ts'
annotations: true
- name: Run unit tests
run: |
npm run test
- name: Add commit hash to version
run: |
npm version prepatch --no-git-tag-version --preid $(git rev-parse --short HEAD)
- name: Build
run: npm run build:ci
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/apps/sag-pkg-community-plugins/**
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run http-server
install: false
wait-on: 'http://localhost:9000/apps/sag-pkg-community-plugins/index.html'
browser: chrome
record: false
config-file: cypress.config.ts
- name: Upload cypress screenshots
uses: actions/upload-artifact@v3
if: failure()
with:
retention-days: 5
name: cypress-screenshots
path: cypress/screenshots
- name: Upload cypress videos
uses: actions/upload-artifact@v3
if: always()
with:
retention-days: 5
name: cypress-videos
path: cypress/videos