-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (111 loc) · 3.71 KB
/
Copy pathbuild.yml
File metadata and controls
129 lines (111 loc) · 3.71 KB
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
name: CI Build
on:
push:
paths-ignore:
- "**.md"
- "LICENSE.txt"
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Build application
run: npm run build:prod
- name: Run unit tests
id: unit-tests
run: npm run test:prod
- name: Upload Test Result Report
if: steps.unit-tests.conclusion != 'skipped'
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2 # v3.0.0
with:
name: Test Results
path: test_results/test-output.xml
reporter: java-junit
report-title: Test Results
- name: Create Code Coverage Summary Report
if: steps.unit-tests.conclusion != 'skipped'
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 #v1.3.0
with:
filename: "test_results/coverage/cobertura-coverage.xml"
badge: true
format: "markdown"
output: "both"
- name: Upload Code Coverage Report
if: steps.unit-tests.conclusion != 'skipped'
run: |
echo "# Code Coverage" >> $GITHUB_STEP_SUMMARY
if [ -f code-coverage-results.md ]; then
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
else
echo "Coverage report not found" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload build artifacts
id: artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: devtoolbox-artifacts
path: dist/dev-tool-box/browser/
retention-days: 5
if-no-files-found: error
e2e:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
strategy:
matrix:
browser: [chrome, firefox, edge]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 1
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: devtoolbox-artifacts
path: dist/dev-tool-box/browser/
- name: Run E2E tests
uses: cypress-io/github-action@948d67d3074f1bbb6379c8bdbb04e95d2f8e593f # v7.4.0
with:
start: npm run start
wait-on: http://localhost:4200
browser: ${{ matrix.browser }}
record: false
spec: cypress/e2e/**/*.cy.ts
- name: Upload Cypress screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: failure()
with:
name: cypress-screenshots-${{ matrix.browser }}
path: cypress/screenshots/
retention-days: 7
if-no-files-found: ignore
- name: Upload Cypress videos
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: cypress-videos-${{ matrix.browser }}
path: cypress/videos/
retention-days: 7
if-no-files-found: ignore