Skip to content

Commit

Permalink
Chore: setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Jul 2, 2022
1 parent 913476c commit 759010e
Show file tree
Hide file tree
Showing 9 changed files with 8,198 additions and 1,343 deletions.
30 changes: 12 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ aliases:
- &coverage
name: Test Coverage
command: npm run test:coverage -- --reporter mocha-junit-reporter --reporter-options mochaFile=reports/test-results/mocha/test-results.xml
- &lint
- &lint-js
name: JavaScript Linter
command: npm run test:lint -- --format junit --output-file ./reports/test-results/eslint/eslint.xml
command: npm run lint:js -- --format junit --output-file ./reports/test-results/eslint/eslint.xml
- &build-firefox
name: Build Firefox
command: npm run build:firefox
- &debt
name: Technical Debt
command: npm run test:debt
- &test-package
name: Test packed app
command: npm run test:package
- &security
name: Validate dependencies
command: npm run test:security
Expand All @@ -58,7 +58,6 @@ aliases:
paths:
- ~/.npm
- node_modules
- lib

version: 2.1
debug: true
Expand Down Expand Up @@ -113,7 +112,11 @@ jobs:
- checkout
- restore_cache:
<<: *cache-defaults
- run: *lint
- run: *lint-js
- run: *build-firefox
- run:
name: Lint Firefox build
command: npm run lint:firefox
- store_test_results:
path: reports
test-leaks:
Expand All @@ -138,13 +141,6 @@ jobs:
- run: *debt
- store_artifacts:
path: reports
test-package:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache-defaults
- run: *test-package
deploy:
<<: *defaults
steps:
Expand All @@ -155,6 +151,7 @@ jobs:
steps:
- restore_cache:
<<: *cache-defaults
- run: *build-firefox
- run:
name: Create Release
command: if [ -z ${CIRCLE_SKIP_DEPLOY+x} ]; then npm run semantic-release;else echo 'job skipped';fi
Expand All @@ -168,9 +165,6 @@ workflows:
- test-security:
requires:
- install
- test-package:
requires:
- install
- test-lint:
requires:
- install
Expand All @@ -187,7 +181,7 @@ workflows:
context: npm-packages
requires:
- test-coverage
- test-package
- test-lint
filters:
branches:
only: master
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
node_modules
src/lib/*
tests/sample/lib/*
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@
"$": "readonly",
"_": "readonly",
"document": "writable"
}
},
"overrides": [
{
"files": ["bin/*.js"],
"rules": {
"node/no-unpublished-import": 0
}
}
]
}
2 changes: 1 addition & 1 deletion .jscpd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"threshold": 5,
"reporters": ["html", "console"],
"ignore": [],
"ignore": [ "src/**/index.html"] ,
"output": "./reports/jscpd",
"minLines": 3,
"minTokens": 30,
Expand Down
58 changes: 58 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"branches": ["master"],
"branch": "master",
"ci": false,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}
],
[
"semantic-release-firefox-add-on", {
"targetXpi": "build/firefox-hermes.xpi",
"sourceDir": "build/firefox",
"channel": "listed",
"artifactsDir": "build"
}
],
[
"@semantic-release/git", {
"assets": ["README.md", "CHANGELOG.md", "package.json"],
"message": "Chore: (release) add version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github", {
"assets": [
{ "path": "build/*.zip", "label": "Packed Extention" },
{ "path": "build/*.xpi", "label": "Signed Extention" }
]
}
],
[
"semantic-release-telegram", {
"chats": [ 238585617 ],
"telegra.ph" : {
"title" : "{name} v.{version}",
"message" : "<a href='{telegraph_url}'>Release Notes</a>",
"content" : "{release_notes}"
}
}
]
],
"preset": "eslint",
"releaseRules": [
{ "tag": "Fix", "release": "patch" },
{ "tag": "Update", "release": "minor" },
{ "tag": "New", "release": "minor" },
{ "tag": "Breaking", "release": "major" },
{ "tag": "Docs", "release": "patch" },
{ "tag": "Upgrade", "release": "patch" }
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
Loading

0 comments on commit 759010e

Please sign in to comment.