@rophy123/helmtest 2.1.5 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,78 @@
1
+ name: CI and Docker Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ env:
10
+ REGISTRY: ghcr.io
11
+ IMAGE_NAME: ${{ github.repository }}
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - name: Checkout source
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: '22'
24
+ cache: 'npm'
25
+
26
+ - name: Install dependencies
27
+ run: npm ci
28
+
29
+ - name: Run linter
30
+ run: npm run lint --if-present
31
+
32
+ - name: Run tests
33
+ run: npm test
34
+
35
+ build-and-push:
36
+ needs: test
37
+ runs-on: ubuntu-latest
38
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
39
+ permissions:
40
+ contents: read
41
+ packages: write
42
+
43
+ steps:
44
+ - name: Checkout source
45
+ uses: actions/checkout@v4
46
+
47
+ - name: Set up Docker Buildx
48
+ uses: docker/setup-buildx-action@v3
49
+
50
+ - name: Login to GitHub Container Registry
51
+ uses: docker/login-action@v3
52
+ with:
53
+ registry: ${{ env.REGISTRY }}
54
+ username: ${{ github.actor }}
55
+ password: ${{ secrets.GITHUB_TOKEN }}
56
+
57
+ - name: Get package version
58
+ id: pkg
59
+ run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
60
+
61
+ - name: Extract metadata for Docker
62
+ id: meta
63
+ uses: docker/metadata-action@v5
64
+ with:
65
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
66
+ tags: |
67
+ type=raw,value=latest
68
+ type=raw,value=${{ steps.pkg.outputs.version }}
69
+
70
+ - name: Build and push Docker image
71
+ uses: docker/build-push-action@v5
72
+ with:
73
+ context: .
74
+ file: ./Dockerfile
75
+ platforms: linux/amd64,linux/arm64
76
+ push: true
77
+ tags: ${{ steps.meta.outputs.tags }}
78
+ labels: ${{ steps.meta.outputs.labels }}
@@ -0,0 +1,34 @@
1
+ name: NPM Publish
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+ contents: read
10
+
11
+ jobs:
12
+ publish:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout source
16
+ uses: actions/checkout@v4
17
+
18
+ - name: Setup Node.js
19
+ uses: actions/setup-node@v4
20
+ with:
21
+ node-version: '24'
22
+ cache: 'npm'
23
+
24
+ - name: Install Helm
25
+ uses: azure/setup-helm@v4
26
+
27
+ - name: Install dependencies
28
+ run: npm ci
29
+
30
+ - name: Run tests
31
+ run: npm test
32
+
33
+ - name: Publish to npm
34
+ run: npm publish --access public
package/CLAUDE.md ADDED
@@ -0,0 +1,10 @@
1
+ # Claude Code Instructions
2
+
3
+ Read CONTRIBUTING.md for contribution guidelines.
4
+
5
+ Before submitting changes, run:
6
+
7
+ ```bash
8
+ make build
9
+ make test
10
+ ```
@@ -0,0 +1,12 @@
1
+ # Contributing
2
+
3
+ ## Before Submitting a PR
4
+
5
+ Please run the following locally:
6
+
7
+ ```bash
8
+ make build
9
+ make test
10
+ ```
11
+
12
+ This builds the Docker image and runs both unit tests and docker usage tests.
package/README.md CHANGED
@@ -64,9 +64,13 @@ npm install -g @rophy123/helmtest jest
64
64
 
65
65
  ...and then you can write unit tests under `tests/` dir of your chart project without the need for package.json
66
66
 
67
- A docker image [rophy/helmtest](https://hub.docker.com/r/rophy/helmtest) is avilable which includes everything to run up unit tests.
67
+ A docker image is available which includes everything to run unit tests:
68
68
 
69
- See [example](../../tree/example) as an example helm chart project on how to use docker image and write unit tests.
69
+ ```bash
70
+ docker run -v $(pwd):/workspace ghcr.io/rophy/helmtest
71
+ ```
72
+
73
+ See [exampleChart/tests](./exampleChart/tests) for example tests.
70
74
 
71
75
  ## API Spec
72
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rophy123/helmtest",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Write unit tests against your helm charts using JavaScript.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -14,19 +14,22 @@
14
14
  "url": "git+https://github.com/rophy/helmtest.git"
15
15
  },
16
16
  "author": "Rophy Tsai <rophy@users.noreply.github.com>",
17
+ "contributors": [
18
+ "Rick Lin <932364+pchikoian@users.noreply.github.com>"
19
+ ],
17
20
  "license": "MIT",
18
21
  "bugs": {
19
22
  "url": "https://github.com/rophy/helmtest/issues"
20
23
  },
21
24
  "homepage": "https://github.com/rophy/helmtest#readme",
22
25
  "dependencies": {
23
- "debug": "^4.3.4",
26
+ "debug": "^4.4.0",
24
27
  "js-yaml": "^4.1.0"
25
28
  },
26
29
  "devDependencies": {
27
- "eslint": "^8.36.0",
30
+ "eslint": "^8.57.0",
28
31
  "eslint-config-google": "^0.14.0",
29
- "jest": "^29.5.0"
32
+ "jest": "^29.7.0"
30
33
  },
31
34
  "peerDependenciesMeta": {
32
35
  "jest": {
@@ -35,5 +38,14 @@
35
38
  },
36
39
  "engines": {
37
40
  "node": ">=16.0.0"
41
+ },
42
+ "directories": {
43
+ "lib": "lib",
44
+ "test": "tests"
45
+ },
46
+ "jest": {
47
+ "testMatch": [
48
+ "<rootDir>/tests/**/*.test.js"
49
+ ]
38
50
  }
39
51
  }