Skip to content

Commit 2c9a7e9

Browse files
authored
ci: add lint pipeline (#44)
1 parent 943c13a commit 2c9a7e9

File tree

13 files changed

+7942
-4597
lines changed

13 files changed

+7942
-4597
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ http://www.stackblitz.com/...
2323

2424
### Versions
2525

26-
- OS: [e.g. iOS]
27-
- Browser [e.g. chrome, safari]
28-
- Angular [e.g. 8]
26+
- OS: [e.g. iOS]
27+
- Browser [e.g. chrome, safari]
28+
- Angular [e.g. 8]
2929

3030
### Additional context
3131

.github/PULL_REQUEST_TEMPLATE.md

+12-18
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,28 @@
22

33
Please check if your PR fulfills the following requirements:
44

5-
- [ ] The commit message follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
6-
- [ ] Tests for the changes have been added (for bug fixes / features)
7-
- [ ] Docs have been added / updated (for bug fixes / features)
5+
- [ ] The commit message follows [Conventional Commits](https://www.conventionalcommits.org/en/)
6+
- [ ] Tests for the changes have been added (for bug fixes / features)
7+
- [ ] Docs have been added / updated (for bug fixes / features)
88

99
## PR Type
1010

1111
What kind of change does this PR introduce?
1212

13-
<!-- Please check the one that applies to this PR using "x". -->
14-
15-
- [ ] Bugfix
16-
- [ ] Feature
17-
- [ ] Refactoring (no functional changes, no api changes)
18-
- [ ] Other... Please describe:
13+
- [ ] Bugfix
14+
- [ ] Feature
15+
- [ ] Refactoring
16+
- [ ] Code style update
17+
- [ ] Build or CI related changes
18+
- [ ] Documentation content changes
1919

2020
## What is the current behavior?
2121

22-
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
23-
24-
Issue Number: N/A
22+
Closes # <!-- link to a relevant issue. -->
2523

2624
## What is the new behavior?
2725

2826
## Does this PR introduce a breaking change?
2927

30-
- [ ] Yes
31-
- [ ] No
32-
33-
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
34-
35-
## Other information
28+
- [ ] Yes
29+
- [ ] No

.github/actions/nodejs/action.yml

+41-41
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,50 @@ name: Action for Node.js
22
description: Node.js setup cache
33

44
inputs:
5-
node-version:
6-
description: Node.js version
7-
required: false
8-
default: 16.x
5+
node-version:
6+
description: Node.js version
7+
required: false
8+
default: 16.x
99

1010
runs:
11-
using: composite
12-
steps:
13-
- name: Use Node.js ${{ inputs.node-version }}
14-
uses: actions/setup-node@v3
15-
with:
16-
node-version: ${{ inputs.node-version }}
17-
registry-url: 'https://registry.npmjs.org'
11+
using: composite
12+
steps:
13+
- name: Use Node.js ${{ inputs.node-version }}
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: ${{ inputs.node-version }}
17+
registry-url: 'https://registry.npmjs.org'
1818

19-
- name: Restore node_modules from cache
20-
id: cache-node-modules
21-
uses: actions/cache@v3
22-
with:
23-
path: |
24-
node_modules
25-
*/*/node_modules/
26-
!node_modules/.cache
27-
!*/*/node_modules/.cache
28-
key: modules-cache__nodejs-${{ inputs.node-version }}__${{ hashfiles('**/package-lock.json') }}
19+
- name: Restore node_modules from cache
20+
id: cache-node-modules
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
node_modules
25+
*/*/node_modules/
26+
!node_modules/.cache
27+
!*/*/node_modules/.cache
28+
key: modules-cache__nodejs-${{ inputs.node-version }}__${{ hashfiles('**/package-lock.json') }}
2929

30-
- name: Restore from cache of builds
31-
id: build-cache
32-
if: steps.cache-node-modules.outputs.cache-hit == 'true'
33-
uses: actions/cache@v3
34-
with:
35-
path: |
36-
node_modules/.cache
37-
*/*/node_modules/.cache
38-
key: builds-cache-hash__${{ hashFiles('**/package-lock.json') }}-${{ github.ref }}
39-
restore-keys: builds-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}
30+
- name: Restore from cache of builds
31+
id: build-cache
32+
if: steps.cache-node-modules.outputs.cache-hit == 'true'
33+
uses: actions/cache@v3
34+
with:
35+
path: |
36+
node_modules/.cache
37+
*/*/node_modules/.cache
38+
key: builds-cache-hash__${{ hashFiles('**/package-lock.json') }}-${{ github.ref }}
39+
restore-keys: builds-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}
4040

41-
- name: Restore from global NPM cache
42-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
43-
uses: actions/cache@v3
44-
with:
45-
path: ~/.npm
46-
key: npm-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}
47-
restore-keys: npm-cache-hash__
41+
- name: Restore from global NPM cache
42+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
43+
uses: actions/cache@v3
44+
with:
45+
path: ~/.npm
46+
key: npm-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}
47+
restore-keys: npm-cache-hash__
4848

49-
- run: npm ci
50-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
51-
shell: bash
49+
- run: npm ci
50+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
51+
shell: bash

.github/workflows/ci.yml

+17-18
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ name: CI of all packages
22
on: push
33

44
jobs:
5-
build:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- name: Setup Node.js and Cache
10-
uses: ./.github/actions/nodejs
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Setup Node.js and Cache
10+
uses: ./.github/actions/nodejs
1111

12-
- name: Install dependencies
13-
run: npm ci
14-
- name: CI checks
15-
run: |
16-
npm run build
17-
npm run format -- --check
18-
npm run lint
19-
npm run test
20-
- name: Coveralls
21-
uses: coverallsapp/github-action@master
22-
with:
23-
github-token: ${{ secrets.GITHUB_TOKEN }}
12+
- name: Install dependencies
13+
run: npm ci
14+
- name: CI checks
15+
run: |
16+
npm run build
17+
npm run test
18+
19+
- name: Coveralls
20+
uses: coverallsapp/github-action@master
21+
with:
22+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Lint
2+
on: [pull_request]
3+
4+
jobs:
5+
lint:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Setup Node.js and Cache
10+
uses: ./.github/actions/nodejs
11+
12+
- name: Lint check
13+
run: |
14+
npm run format -- --check
15+
npm run lint
16+
17+
concurrency:
18+
group: lint-${{ github.head_ref }}
19+
cancel-in-progress: true

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
3+
All notable changes to this project will be documented in this file. See
4+
[standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

CODE_OF_CONDUCT.md

+33-48
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,60 @@
22

33
## Our Pledge
44

5-
In the interest of fostering an open and welcoming environment, we as
6-
contributors and maintainers pledge to making participation in our project and
7-
our community a harassment-free experience for everyone, regardless of age, body
8-
size, disability, ethnicity, sex characteristics, gender identity and expression,
9-
level of experience, education, socio-economic status, nationality, personal
10-
appearance, race, religion, or sexual identity and orientation.
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
6+
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
7+
disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
8+
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
119

1210
## Our Standards
1311

14-
Examples of behavior that contributes to creating a positive environment
15-
include:
12+
Examples of behavior that contributes to creating a positive environment include:
1613

17-
- Using welcoming and inclusive language
18-
- Being respectful of differing viewpoints and experiences
19-
- Gracefully accepting constructive criticism
20-
- Focusing on what is best for the community
21-
- Showing empathy towards other community members
14+
- Using welcoming and inclusive language
15+
- Being respectful of differing viewpoints and experiences
16+
- Gracefully accepting constructive criticism
17+
- Focusing on what is best for the community
18+
- Showing empathy towards other community members
2219

2320
Examples of unacceptable behavior by participants include:
2421

25-
- The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
- Trolling, insulting/derogatory comments, and personal or political attacks
28-
- Public or private harassment
29-
- Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
- Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
22+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
23+
- Trolling, insulting/derogatory comments, and personal or political attacks
24+
- Public or private harassment
25+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
26+
- Other conduct which could reasonably be considered inappropriate in a professional setting
3327

3428
## Our Responsibilities
3529

36-
Project maintainers are responsible for clarifying the standards of acceptable
37-
behavior and are expected to take appropriate and fair corrective action in
38-
response to any instances of unacceptable behavior.
30+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
31+
appropriate and fair corrective action in response to any instances of unacceptable behavior.
3932

40-
Project maintainers have the right and responsibility to remove, edit, or
41-
reject comments, commits, code, wiki edits, issues, and other contributions
42-
that are not aligned to this Code of Conduct, or to ban temporarily or
43-
permanently any contributor for other behaviors that they deem inappropriate,
44-
threatening, offensive, or harmful.
33+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
34+
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
35+
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
4536

4637
## Scope
4738

48-
This Code of Conduct applies both within project spaces and in public spaces
49-
when an individual is representing the project or its community. Examples of
50-
representing a project or community include using an official project e-mail
51-
address, posting via an official social media account, or acting as an appointed
52-
representative at an online or offline event. Representation of a project may be
53-
further defined and clarified by project maintainers.
39+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
40+
project or its community. Examples of representing a project or community include using an official project e-mail
41+
address, posting via an official social media account, or acting as an appointed representative at an online or offline
42+
event. Representation of a project may be further defined and clarified by project maintainers.
5443

5544
## Enforcement
5645

57-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [INSERT YOUR EMAIL HERE]. All
59-
complaints will be reviewed and investigated and will result in a response that
60-
is deemed necessary and appropriate to the circumstances. The project team is
61-
obligated to maintain confidentiality with regard to the reporter of an incident.
62-
Further details of specific enforcement policies may be posted separately.
46+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
47+
[INSERT YOUR EMAIL HERE]. All complaints will be reviewed and investigated and will result in a response that is deemed
48+
necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to
49+
the reporter of an incident. Further details of specific enforcement policies may be posted separately.
6350

64-
Project maintainers who do not follow or enforce the Code of Conduct in good
65-
faith may face temporary or permanent repercussions as determined by other
66-
members of the project's leadership.
51+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
52+
repercussions as determined by other members of the project's leadership.
6753

6854
## Attribution
6955

70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
56+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
57+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
7258

7359
[homepage]: https://www.contributor-covenant.org
7460

75-
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
61+
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
> Thank you for considering contributing to our project. Your help if very welcome!
44
5-
When contributing, it's better to first discuss the change you wish to make via issue,
6-
email, or any other method with the owners of this repository before making a change.
5+
When contributing, it's better to first discuss the change you wish to make via issue, email, or any other method with
6+
the owners of this repository before making a change.
77

8-
All members of our community are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
9-
Please make sure you are welcoming and friendly in all of our spaces.
8+
All members of our community are expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md). Please make sure you are
9+
welcoming and friendly in all of our spaces.
1010

1111
## Getting started
1212

13-
In order to make your contribution please make a fork of the repository. After you've pulled
14-
the code, follow these steps to kick start the development:
13+
In order to make your contribution please make a fork of the repository. After you've pulled the code, follow these
14+
steps to kick-start the development:
1515

1616
1. Run `npm ci` to install dependencies
1717
2. Run `npm start` to launch demo project where you could test your changes
@@ -25,8 +25,8 @@ npm run test
2525

2626
## Pull Request Process
2727

28-
1. We follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
29-
in our commit messages, i.e. `feat(core): improve typing`
28+
1. We follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) in our commit messages, i.e.
29+
`feat(core): improve typing`
3030
2. Update [README.md](README.md) to reflect changes related to public API and everything relevant
3131
3. Make sure you cover all code changes with unit tests
3232
4. When you are ready, create Pull Request of your fork into original repository

0 commit comments

Comments
 (0)