Skip to content

Commit 541cb23

Browse files
authored
chore: fix workflow os matrix (#47)
1 parent 5c5eb59 commit 541cb23

12 files changed

+148
-131
lines changed

.eslintignore

-2
This file was deleted.

.eslintrc

-10
This file was deleted.

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/release.yml

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
name: Release on main
22

33
permissions:
4-
contents: write # to be able to publish a GitHub release
5-
issues: write # to be able to comment on released issues
6-
pull-requests: write # to be able to comment on released pull requests
7-
id-token: write # to enable use of OIDC for npm provenance
4+
contents: write # to be able to publish a GitHub release
5+
issues: write # to be able to comment on released issues
6+
pull-requests: write # to be able to comment on released pull requests
7+
id-token: write # to enable use of OIDC for npm provenance
88

99
on:
10-
push:
11-
branches:
12-
- main
10+
push:
11+
branches:
12+
- main
1313

1414
# Cancel previous workflows which might still be running
1515
concurrency:
16-
group: ${{ github.workflow }}-${{ github.ref }}
17-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1818

1919
jobs:
20-
release:
21-
name: Release
22-
runs-on: ubuntu-latest
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v4
26-
27-
- name: Install Node.js
28-
uses: actions/setup-node@v4
29-
with:
30-
node-version: 20
31-
32-
- name: Install dependencies
33-
run: npm install
34-
35-
- name: Run all tests
36-
run: npm test
37-
38-
- name: Release and publish
39-
run: npx semantic-release
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
release:
21+
name: Release
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Install Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
32+
- name: Install dependencies
33+
run: npm install
34+
35+
- name: Run all tests
36+
run: npm test
37+
38+
- name: Release and publish
39+
run: npx semantic-release
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
name: Run Lint and Tests
22

33
on:
4-
pull_request:
5-
branches: [main]
4+
pull_request:
5+
branches: [main]
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
os: [ubuntu-latest, macOS-latest, windows-latest]
13-
node-version: [18.x, 20.x]
14-
steps:
15-
- uses: actions/checkout@v4
8+
build:
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, macOS-latest, windows-latest]
12+
node-version: [18, 20]
13+
runs-on: ${{ matrix.os }}
1614

17-
- name: Use Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v4
19-
with:
20-
node-version: ${{ matrix.node-version }}
15+
steps:
16+
- uses: actions/checkout@v4
2117

22-
- name: Install dependencies
23-
run: npm install
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
2422

25-
- name: Lint
26-
run: npm run lint
23+
- name: Install dependencies
24+
run: npm install
2725

28-
- name: Run tests
29-
run: npm test
26+
- name: Lint
27+
run: npm run lint
28+
29+
- name: Run tests
30+
run: npm test

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=false
2+
save-exact=true

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package.json
2+
package-lock.json

.prettierrc

-15
This file was deleted.

.prettierrc.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"singleQuote": false,
3+
"trailingComma": "all",
4+
"useTabs": true,
5+
"printWidth": 120,
6+
"overrides": [
7+
{
8+
"files": ["*.yml", "*.json"],
9+
"options": {
10+
"tabWidth": 2,
11+
"useTabs": false
12+
}
13+
}
14+
]
15+
}

eslint.config.mjs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import prettierConfig from "eslint-config-prettier";
2+
import prettierPlugin from "eslint-plugin-prettier/recommended";
3+
import globals from "globals";
4+
import js from "@eslint/js";
5+
6+
export default [
7+
js.configs.recommended,
8+
prettierConfig,
9+
prettierPlugin,
10+
{
11+
languageOptions: {
12+
globals: {
13+
...globals.node,
14+
...globals.browser,
15+
global: true,
16+
},
17+
},
18+
},
19+
{
20+
ignores: ["coverage/*", "dist/*"],
21+
},
22+
];

lib/udpd.js

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const MetricsDaemonUdpd = class MetricsDaemonUdpd extends EventEmitter {
3535
const obj = JSON.parse(data);
3636
const metric = new Metric(obj);
3737
this.emit("message", metric);
38+
// eslint-disable-next-line no-unused-vars
3839
} catch (err) {
3940
this.log.error(`Recieved non metric object from ${info.address}:${info.port}`);
4041
}

package.json

+53-52
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,55 @@
11
{
2-
"name": "@metrics/daemon",
3-
"version": "1.0.0",
4-
"description": "Daemon for collecting metrics over misc network protocols. Provides a stream for further piping of metrics.",
5-
"main": "lib/daemon.js",
6-
"bin": {
7-
"metricd": "./bin/bin.js"
8-
},
9-
"scripts": {
10-
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
11-
"test:coverage": "tap test/*.js",
12-
"lint": "eslint .",
13-
"lint:fix": "eslint . --fix"
14-
},
15-
"repository": {
16-
"type": "git",
17-
"url": "git+https://github.com/metrics-js/daemon.git"
18-
},
19-
"author": "Trygve Lie",
20-
"license": "MIT",
21-
"bugs": {
22-
"url": "https://github.com/metrics-js/daemon/issues"
23-
},
24-
"homepage": "https://github.com/metrics-js/daemon#readme",
25-
"keywords": [
26-
"server-statistics",
27-
"server-stats",
28-
"statistics",
29-
"metrics",
30-
"monitoring",
31-
"daemon"
32-
],
33-
"dependencies": {
34-
"abslog": "^2.4.0",
35-
"readable-stream": "^3.4.0",
36-
"@metrics/metric": "^2.3.1"
37-
},
38-
"devDependencies": {
39-
"@metrics/client": "2.5.2",
40-
"@metrics/emitter": "0.0.2",
41-
"@semantic-release/changelog": "6.0.3",
42-
"@semantic-release/commit-analyzer": "11.1.0",
43-
"@semantic-release/git": "10.0.1",
44-
"@semantic-release/github": "9.2.6",
45-
"@semantic-release/npm": "11.0.3",
46-
"@semantic-release/release-notes-generator": "12.1.0",
47-
"eslint": "8.57.0",
48-
"eslint-config-prettier": "9.1.0",
49-
"eslint-plugin-prettier": "5.1.3",
50-
"prettier": "3.3.0",
51-
"semantic-release": "23.0.2",
52-
"tap": "18.7.1"
53-
}
2+
"name": "@metrics/daemon",
3+
"version": "1.0.0",
4+
"description": "Daemon for collecting metrics over misc network protocols. Provides a stream for further piping of metrics.",
5+
"main": "lib/daemon.js",
6+
"bin": {
7+
"metricd": "./bin/bin.js"
8+
},
9+
"scripts": {
10+
"test": "tap test/*.js --disable-coverage --allow-empty-coverage",
11+
"test:coverage": "tap test/*.js",
12+
"lint": "eslint .",
13+
"lint:fix": "eslint . --fix"
14+
},
15+
"repository": {
16+
"type": "git",
17+
"url": "git+https://github.com/metrics-js/daemon.git"
18+
},
19+
"author": "Trygve Lie",
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/metrics-js/daemon/issues"
23+
},
24+
"homepage": "https://github.com/metrics-js/daemon#readme",
25+
"keywords": [
26+
"server-statistics",
27+
"server-stats",
28+
"statistics",
29+
"metrics",
30+
"monitoring",
31+
"daemon"
32+
],
33+
"dependencies": {
34+
"@metrics/metric": "^2.3.1",
35+
"abslog": "^2.4.0",
36+
"readable-stream": "^3.4.0"
37+
},
38+
"devDependencies": {
39+
"@metrics/client": "2.5.2",
40+
"@metrics/emitter": "0.0.2",
41+
"@semantic-release/changelog": "6.0.3",
42+
"@semantic-release/commit-analyzer": "11.1.0",
43+
"@semantic-release/git": "10.0.1",
44+
"@semantic-release/github": "9.2.6",
45+
"@semantic-release/npm": "11.0.3",
46+
"@semantic-release/release-notes-generator": "12.1.0",
47+
"eslint": "9.6.0",
48+
"eslint-config-prettier": "9.1.0",
49+
"eslint-plugin-prettier": "5.1.3",
50+
"globals": "15.8.0",
51+
"prettier": "3.3.0",
52+
"semantic-release": "23.0.2",
53+
"tap": "18.7.1"
54+
}
5455
}

0 commit comments

Comments
 (0)