Skip to content

Commit fa5d5da

Browse files
authored
Merge pull request #28 from Flagsmith/chore/npm-test-on-pr
chore: Add build and test workflow, fix npm audit issues
2 parents 1893840 + 7cae5cd commit fa5d5da

File tree

5 files changed

+52
-15
lines changed

5 files changed

+52
-15
lines changed

.github/actions/install/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Clone and Install"
2+
description: "Clones repository and sets up Node environment"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up Node
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version: '18.x'
10+
registry-url: 'https://registry.npmjs.org'
11+
12+
- name: Install dependencies
13+
run: npm install
14+
shell: bash

.github/workflows/publish.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ jobs:
1111
name: Publish NPM Package
1212

1313
steps:
14-
- name: Cloning repo
14+
- name: Check out repository
1515
uses: actions/checkout@v4
1616

17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: '18.x'
20-
registry-url: 'https://registry.npmjs.org'
17+
- name: Clone and Install
18+
uses: ./.github/actions/install
2119

22-
- run: npm i
2320
- run: npm run deploy
2421
env:
2522
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build_and_test:
11+
concurrency:
12+
group: ${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Clone and Install
22+
uses: ./.github/actions/install
23+
24+
- name: Build
25+
run: npm run build

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@
1717
"/oclif.manifest.json"
1818
],
1919
"dependencies": {
20-
"@oclif/core": "^1.16.0",
21-
"@oclif/plugin-help": "^5",
22-
"@oclif/plugin-plugins": "^2.0.1",
20+
"@oclif/core": "^1.26.2",
21+
"@oclif/plugin-help": "^6.2.27",
22+
"@oclif/plugin-plugins": "^5.4.36",
2323
"flagsmith": "^9.0.5",
2424
"node-fetch": "^2.6.6"
2525
},
2626
"devDependencies": {
2727
"@oclif/test": "^2.1.1",
2828
"@types/chai": "^4",
2929
"@types/mocha": "^9.0.0",
30-
"@types/node": "^16.9.4",
31-
"@types/node-fetch": "^2.6.2",
30+
"@types/node": "^18.19.83",
31+
"@types/node-fetch": "^2.6.6",
3232
"chai": "^4",
3333
"eslint": "^7.32.0",
3434
"eslint-config-oclif": "^4",
3535
"eslint-config-oclif-typescript": "^1.0.2",
3636
"globby": "^11",
37-
"mocha": "^9",
38-
"oclif": "^3",
37+
"mocha": "^11.1.0",
38+
"oclif": "^4.17.41",
3939
"shx": "^0.3.3",
4040
"ts-node": "^10.2.1",
4141
"tslib": "^2.3.1",
42-
"typescript": "4.4.4"
42+
"typescript": "5.8.2"
4343
},
4444
"oclif": {
4545
"bin": "flagsmith",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"outDir": "dist",
77
"rootDir": "src",
88
"strict": true,
9-
"target": "es2019"
9+
"target": "es2019",
10+
"skipLibCheck": true
1011
},
1112
"include": [
1213
"src/**/*"

0 commit comments

Comments
 (0)