Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Before running the workflow, you need to configure the following secret in your
- Go to your repository → Settings → Secrets and variables → Actions
- Add the following repository secret:

| Secret Name | Description |
|-------------|-------------|
| Secret Name | Description |
| ----------- | -------------------------------------------------- |
| `NPM_TOKEN` | Your NPM Granular Access Token (created in step 1) |

### How to Run
Expand Down Expand Up @@ -64,19 +64,19 @@ This workflow runs an end-to-end test to verify that two `hinter-core` instances
The workflow consists of two parallel jobs, `hinter1` and `hinter2`.

1. **Setup**:
* Each job checks out the repository and installs dependencies.
* It builds the npm package using `npm run build:package`.
* It installs the built package globally (`npm install -g ...`) along with `pm2`.
- Each job checks out the repository and installs dependencies.
- It builds the npm package using `npm run build:package`.
- It installs the built package globally (`npm install -g ...`) along with `pm2`.

2. **Execution**:
* Each job runs `hinter-core-initialize` to set up a local data directory.
* It then starts the `hinter-core` application as a background service using `pm2`.
* `hinter1` creates a report file (`report-from-1.txt`) in its outgoing directory for `hinter2`.
* `hinter2` creates a report file (`report-from-2.txt`) in its outgoing directory for `hinter1`.
- Each job runs `hinter-core-initialize` to set up a local data directory.
- It then starts the `hinter-core` application as a background service using `pm2`.
- `hinter1` creates a report file (`report-from-1.txt`) in its outgoing directory for `hinter2`.
- `hinter2` creates a report file (`report-from-2.txt`) in its outgoing directory for `hinter1`.

3. **Verification**:
* Each node waits for the other's report file to appear in its incoming directory and verifies the content.
* If a report is not received within the timeout period (180 seconds), the workflow fails.
- Each node waits for the other's report file to appear in its incoming directory and verifies the content.
- If a report is not received within the timeout period (180 seconds), the workflow fails.

### How to Run

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Continuous Build

on:
push:
branches:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
node_modules
.DS_Store
.eslintcache

.storage
hinter-core-data*
fuzz
.env

.idea
.vscode
tmp
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
3 changes: 1 addition & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
{
"files": "*.md",
"options": {
"parser": "markdown",
"proseWrap": "always"
"parser": "markdown"
}
}
]
Expand Down
17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import js from '@eslint/js';
import globals from 'globals';
import { defineConfig } from 'eslint/config';
import prettierConfig from 'eslint-config-prettier';

export default defineConfig([
{
files: ['**/*.{js,mjs,cjs}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.node },
},
prettierConfig,
{
ignores: ['node_modules/**', 'fuzz/**', 'tmp/**'],
},
]);
Loading