-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (77 loc) · 2.27 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
84
85
86
87
88
89
90
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:node-20.11.1-chrome-123.0.6312.58-1-ff-124.0-edge-122.0.2365.92-1
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
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
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/sag-pkg-community-plugins/**
- name: Copy files for http-server into apps subfolder
run: |
mkdir -p dist/apps/sag-pkg-community-plugins
cp -r dist/sag-pkg-community-plugins/* dist/apps/sag-pkg-community-plugins
- name: Cypress run
uses: cypress-io/github-action@v5
env:
grepTags: '@noShell'
with:
start: npm run http-server
install: false
wait-on: 'http://localhost:4200/apps/sag-pkg-community-plugins/index.html'
browser: chrome
record: false
config-file: cypress.config.ts
- name: Upload cypress screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
retention-days: 5
name: cypress-screenshots
path: cypress/screenshots
- name: Upload cypress videos
uses: actions/upload-artifact@v4
if: always()
with:
retention-days: 5
name: cypress-videos
path: cypress/videos