-
Notifications
You must be signed in to change notification settings - Fork 4
125 lines (124 loc) · 3.24 KB
/
main.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
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
name: main
on:
push:
branches:
- main
pull_request: {}
jobs:
install:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
check-format:
name: Check Format
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Check Format
run: npm run format:check
lint:
name: Lint
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Lint
run: npm run lint -- --format junit -o lint-results.xml
- name: Upload Report
uses: actions/upload-artifact@v4
if: always()
with:
name: lint-results
path: lint-results.xml
check-types:
name: Check Typescript Types
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Check Typescript Types
run: npm run check-types
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Unit Tests
run: npm run test:coverage
env:
NODE_OPTIONS: --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=unit-test-results.xml
- name: Upload Report to Codecov
uses: codecov/codecov-action@v5
if: always()
- name: Upload Report
uses: actions/upload-artifact@v4
if: always()
with:
name: unit-test-results
path: unit-test-results.xml
e2e-test:
name: End-2-end Tests
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Install e2e tests dependencies
run: npm run test:e2e:install
- name: End-2-end Tests
run: npm run test:e2e
build:
name: Build
runs-on: ubuntu-latest
needs:
- check-format
- lint
- check-types
- unit-test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Build
run: npm run build
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: bundle
path: hello-web-components.min.*
size:
name: Check Size
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: fernandopasik/actions/setup-node@main
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: bundle
- name: Check Size
run: npm run size