Skip to content

Commit

Permalink
AG-35878 Migrate to Bitbucket
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/ecsstree from fix/AG-35878 to master

Squashed commit of the following:

commit b090b42
Author: scripthunter7 <[email protected]>
Date:   Tue Sep 10 16:39:47 2024 +0200

    fixes

commit 10e4fd0
Author: Slava Leleka <[email protected]>
Date:   Tue Sep 10 17:01:35 2024 +0300

    bamboo-specs/build.yaml edited online with Bitbucket

commit 4498fb3
Author: scripthunter7 <[email protected]>
Date:   Tue Sep 10 15:12:58 2024 +0200

    update changelog

commit 495c30d
Author: scripthunter7 <[email protected]>
Date:   Tue Sep 10 15:11:05 2024 +0200

    Migrate to Bitbucket

commit 97f1412
Author: scripthunter7 <[email protected]>
Date:   Tue Sep 10 09:50:25 2024 +0200

    update types

commit 81f2a2c
Author: scripthunter7 <[email protected]>
Date:   Tue Sep 10 09:50:17 2024 +0200

    update exports
  • Loading branch information
scripthunter7 committed Sep 10, 2024
1 parent 9f483c4 commit d1c54a0
Show file tree
Hide file tree
Showing 40 changed files with 3,130 additions and 1,807 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
examples
examples
test/smoke
82 changes: 82 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
const MAX_LINE_LENGTH = 120;
const TAB_WIDTH = 4;

module.exports = {
root: true,
env: { jest: true },
parserOptions: {
ecmaVersion: 'latest',
},
plugins: [
'import',
'import-newlines',
],
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:jsdoc/recommended',
],
ignorePatterns: [
'dist',
'coverage',
'examples',
],
rules: {
'max-len': [
'error',
{
code: MAX_LINE_LENGTH,
comments: MAX_LINE_LENGTH,
tabWidth: TAB_WIDTH,
ignoreUrls: true,
ignoreTrailingComments: false,
ignoreComments: false,
},
],
indent: [
'error',
TAB_WIDTH,
{
SwitchCase: 1,
},
],

'arrow-body-style': 'off',
'no-await-in-loop': 'off',
'no-continue': 'off',
'no-new': 'off',
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],

'import/prefer-default-export': 'off',
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }],
// Split external and internal imports with an empty line
'import/order': [
'error',
{
groups: [
['builtin', 'external'],
],
'newlines-between': 'always',
},
],

'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true }],
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/tag-lines': [
'warn',
'any',
{
startLines: 1,
},
],
'jsdoc/check-tag-names': [
'warn',
{
// Define additional tags
// https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md#definedtags
definedTags: ['note'],
},
],
},
};
18 changes: 0 additions & 18 deletions .eslintrc.yml

This file was deleted.

56 changes: 46 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,69 @@
name: Code check

env:
NODE_VERSION: 20

on:
push:
branches:
- main
paths-ignore: ["*.md", "examples/**"]
- master
pull_request:
branches:
- main
paths-ignore: ["*.md", "examples/**"]
- master

jobs:
code_check:
check_code:
name: Run type checking, linting, and testing
runs-on: ubuntu-latest
steps:
- name: Check out to repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run ESLint
- name: Lint code
run: yarn lint

- name: Run Jest tests
- name: Run tests
run: yarn test

- name: Check build
run: yarn build

- name: Run smoke tests
run: yarn test:smoke

notify:
name: Send Slack notification on failure
needs: check_code
# Run this job only if the previous job failed and the event was triggered by the 'AdguardTeam/ecsstree' repository
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{
always() &&
needs.check_code.result == 'failure' &&
github.repository == 'AdguardTeam/ecsstree' &&
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
)
}}
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: failure
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: check_code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
42 changes: 0 additions & 42 deletions .github/workflows/publish.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Create GitHub Release

env:
NODE_VERSION: 20

on:
push:
tags:
- v*

# Workflow need write access to the repository to create a release
permissions:
contents: write

# Make sure that only one release workflow runs at a time
concurrency:
group: release

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint code
run: yarn lint

- name: Run tests
run: yarn test

- name: Check build
run: yarn build

- name: Run smoke tests
run: yarn test:smoke

- name: Pack files
run: yarn pack --filename ecsstree.tgz

- name: Release on GitHub
uses: softprops/action-gh-release@v1
with:
files: |
ecsstree.tgz
draft: false
prerelease: false
# TODO: Extract data from CHANGELOG.md
body: See [CHANGELOG.md](./CHANGELOG.md) for the list of changes.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify:
name: Send Slack notification
needs: release
# Note: 'always()' is needed to run the notify job even if the test job was failed
if:
${{
always() &&
github.repository == 'AdguardTeam/ecsstree' &&
github.event_name == 'push'
}}
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ needs.release.result }}
fields: workflow, repo, message, commit, author, eventName, ref, job
job_name: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading

0 comments on commit d1c54a0

Please sign in to comment.