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
14 changes: 7 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"root": true,
"extends": ["@jupiterone/eslint-config/node"],
"extends": ["@jupiterone/eslint-config/node18"],
"ignorePatterns": [
"node_modules/",
"dist/",
"work/",
"coverage/",
"bak/",
"index.js",
"tools/",
"tools/"
],
"parserOptions": {
"es6": true,
"project": "./tsconfig.json",
"tsconfigRootDir": ".",
"tsconfigRootDir": "."
},
"overrides": [
{
"files": ["**/*.spec.js", "**/*.spec.jsx"],
"env": {
"jest": true,
},
},
],
"jest": true
}
}
]
}
47 changes: 26 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@ on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [18.x]
os: [ubuntu-latest]
node-version: [24.x]

steps:
- id: setup-node
name: Setup Node
uses: actions/setup-node@v3
- name: Check out code repository source code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Check out code repository source code
uses: actions/checkout@v2
- name: Verify Docker and Docker Compose
run: |
docker --version
docker compose version

- name: Install dependencies
run: yarn
run: npm ci

- name: Start containers and run tests
run: yarn test:ci
run: npm run test:ci

- name: Run build
run: yarn build
run: npm run build

# Publishing is done in a separate job to allow
# for all matrix builds to complete.
Expand All @@ -38,20 +41,21 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [18]
node-version: [24.x]

steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Check if publish needed
id: should-publish
run: |
name="$(jq -r .name package.json)"
npmver="$(npm show $name version || echo v0.0.0)"
Expand All @@ -62,14 +66,15 @@ jobs:
else
echo "Package version ($pkgver) is different from latest NPM version ($npmver), publishing!"
echo "publish=true" >> $GITHUB_ENV
echo "version=${pkgver}" >> $GITHUB_OUTPUT
fi

- name: Publish
if: env.publish == 'true'
if: steps.should-publish.outputs.publish == 'true'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
yarn
yarn build
npm ci
npm run build
npm publish ./dist
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist/
coverage/
node_modules/
yarn-error.log
npm-debug.log
.DS_Store
.eslintcache
.idea
Expand Down
2 changes: 1 addition & 1 deletion .huskyrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "yarn build"
"pre-push": "npm run build"
}
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,19 @@ first open one terminal and start the local DynamoDB docker container by
running:

```
yarn start:containers
npm run start:containers
```

In a second terminal run:

```
yarn test
npm test
```

To stop containers:

```
yarn stop:containers
npm run stop:containers
```

## Releasing
Expand Down
8 changes: 3 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
version: '3'

services:
dynamodb:
image: 'public.ecr.aws/aws-dynamodb-local/aws-dynamodb-local:1.19.0'
image: 'amazon/dynamodb-local:latest'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ports:
- 8000:8000
test:
image: public.ecr.aws/docker/library/node:18-alpine3.16
image: node:24-alpine
environment:
- DYNAMODB_ENDPOINT=http://dynamodb:8000
depends_on:
- dynamodb
volumes:
- ./:/opt/work:delegated
working_dir: /opt/work
command: sh -c "yarn jest --ci"
command: sh -c "npm test -- --ci"
Loading