Skip to content

Commit 425cc8c

Browse files
xiaoweiizxkane
authored andcommitted
feat: add github actions
1 parent 8890942 commit 425cc8c

File tree

10 files changed

+319
-63
lines changed

10 files changed

+319
-63
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Bug Report
2+
description: Create a report to help us improve
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Describe the bug
8+
description: A clear and concise description of what the bug is.
9+
validations:
10+
required: true
11+
- type: textarea
12+
id: repro
13+
attributes:
14+
label: Steps To Reproduce
15+
description: How do you trigger this bug? Please walk us through it step by step.
16+
value: |
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
render: typescript
23+
validations:
24+
required: true
25+
- type: textarea
26+
id: behavior
27+
attributes:
28+
label: Expected behavior
29+
description: A clear and concise description of what you expected to happen.
30+
validations:
31+
required: true
32+
- type: input
33+
id: clickstream-version
34+
attributes:
35+
label: Clickstream-Web Version
36+
placeholder: e.g. 1.0.0
37+
validations:
38+
required: true
39+
- type: input
40+
id: node
41+
attributes:
42+
label: Node version
43+
placeholder: e.g. 18.12.1
44+
validations:
45+
required: true
46+
- type: input
47+
id: typescript
48+
attributes:
49+
label: TypeScript version
50+
placeholder: |
51+
- e.g. 4.9.5
52+
validations:
53+
required: true
54+
- type: textarea
55+
id: logs
56+
attributes:
57+
label: Relevant log output
58+
description: >-
59+
Include any relevant log output
60+
value: |
61+
<details>
62+
<summary>Log Messages</summary>
63+
64+
```
65+
INSERT LOG MESSAGES HERE
66+
```
67+
</details>
68+
render: shell
69+
- type: dropdown
70+
id: regression
71+
attributes:
72+
label: Is this a regression?
73+
multiple: false
74+
options:
75+
- "Yes"
76+
- "No"
77+
validations:
78+
required: true
79+
- type: textarea
80+
id: regression-info
81+
attributes:
82+
label: Regression additional context
83+
placeholder: If it was a regression provide the versions used before and after the upgrade.
84+
- type: input
85+
id: device
86+
attributes:
87+
label: Browser
88+
placeholder: |
89+
- e.g. Chrome/114.0.0.0
90+
- Safari/537.36
91+
validations:
92+
required: true
93+
- type: textarea
94+
id: context
95+
attributes:
96+
label: Additional context
97+
description: Add any other context about the problem here.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
body:
4+
- type: textarea
5+
id: description
6+
attributes:
7+
label: Is your feature request related to a problem? Please describe.
8+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
validations:
10+
required: true
11+
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Describe the solution you'd like
16+
description: A clear and concise description of what you want to happen.
17+
validations:
18+
required: true
19+
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Describe alternatives you've considered
24+
description: A clear and concise description of any alternative solutions or features you've considered.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional context
32+
description: Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Issue \#
2+
<!-- If applicable, please link to issue(s) this change addresses -->
3+
4+
## Description
5+
<!-- Why is this change required? What problem does it solve? -->
6+
7+
## General Checklist
8+
<!-- Check or cross out if not relevant -->
9+
10+
- [ ] Added new tests to cover change, if needed
11+
- [ ] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
12+
- [ ] Documentation update for the change if required
13+
- [ ] PR title conforms to conventional commit style
14+
- [ ] If breaking change, documentation/changelog update with migration instructions
15+
16+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Web SDK Build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
code-build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run build
15+
run: |
16+
npm i
17+
npm run build

.github/workflows/code-lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Web SDK Lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
code-lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run npm install
15+
run: npm i
16+
- name: Run code format
17+
run: npm run format
18+
- name: Run code lint
19+
run: npm run lint

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Web SDK Test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
code-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Run test
15+
run: |
16+
npm i
17+
npm run test
18+
- name: Upload Test Report
19+
uses: codecov/codecov-action@v3
20+
with:
21+
name: report
22+
files: coverage/clover.xml

.github/workflows/title-lint.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Commit Title Lint
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
title-lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: amannn/action-semantic-pull-request@v3.2.6
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
with:
15+
# Configure which types are allowed.
16+
# Default: https://github.com/commitizen/conventional-commit-types
17+
types: |
18+
fix
19+
feat
20+
docs
21+
style
22+
refactor
23+
perf
24+
test
25+
build
26+
ci
27+
chore
28+
revert
29+
release
30+
# Configure that a scope must always be provided.
31+
requireScope: false
32+
# Configure additional validation for the subject based on a regex.
33+
# This example ensures the subject doesn't start with an uppercase character.
34+
subjectPattern: ^(?![A-Z]).+$
35+
# If `subjectPattern` is configured, you can use this property to override
36+
# the default error message that is shown when the pattern doesn't match.
37+
# The variables `subject` and `title` can be used within the message.
38+
subjectPatternError: |
39+
The subject "{subject}" found in the pull request title "{title}"
40+
didn't match the configured pattern. Please ensure that the subject
41+
doesn't start with an uppercase character.
42+
# For work-in-progress PRs you can typically use draft pull requests
43+
# from Github. However, private repositories on the free plan don't have
44+
# this option and therefore this action allows you to opt-in to using the
45+
# special "[WIP]" prefix to indicate this state. This will avoid the
46+
# validation of the PR title and the pull request checks remain pending.
47+
# Note that a second check will be reported if this is enabled.
48+
wip: true

.gitlab-ci.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)