diff --git a/.github/workflows/ci-checks.yaml b/.github/workflows/ci-checks.yaml index 0d8bec9..6c97292 100644 --- a/.github/workflows/ci-checks.yaml +++ b/.github/workflows/ci-checks.yaml @@ -12,6 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - run: npm install - - run: npm run test:ci + - run: | + npm run test:ci diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index db4cba1..36b3404 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 registry-url: https://registry.npmjs.org/ - name: Install packages diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 18f57ee..0475a74 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -14,7 +14,7 @@ jobs: unit: strategy: matrix: - node-version: [16.x] + node-version: [18.x, 20.x, 22.x] fail-fast: false runs-on: ubuntu-latest steps: @@ -33,7 +33,7 @@ jobs: integration: strategy: matrix: - node-version: [16.x] + node-version: [18.x, 20.x, 22.x] os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false runs-on: ${{ matrix.os }} @@ -57,7 +57,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Install packages run: npm ci diff --git a/README.md b/README.md index 2a413f7..7f347bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # act-js +> **Notice** +> +> We have introduced experimental support for fetch in mock-github. This is a release of act-js with the beta version of mock-github. You can install it by: +> +> ``` +> npm install @kie/act-js@beta +> ``` + + Installs [nektos/act](https://github.com/nektos/act) and provides access to it as a CLI as well as an API ## Table of Content diff --git a/package-lock.json b/package-lock.json index 78ed622..f4090de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { - "@kie/mock-github": "^2.0.0", + "@kie/mock-github": "^3.0.0-beta.1", "adm-zip": "^0.5.10", "ajv": "^8.12.0", "bin-links": "^4.0.1", @@ -44,6 +44,9 @@ "ts-node": "^10.8.1", "tsc-alias": "^1.7.1", "typescript": "^4.7.4" + }, + "engines": { + "node": ">=18" } }, "node_modules/@actions/github": { @@ -1230,18 +1233,33 @@ } }, "node_modules/@kie/mock-github": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@kie/mock-github/-/mock-github-2.0.0.tgz", - "integrity": "sha512-od6UyICJYKMnz9HgEWCQAFT/JsCpKkLp+JQH8fV23tf+ZmmQI1dK3C20k6aO5uJhAHA0yOcFtbKFVF4+8i3DTg==", + "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@kie/mock-github/-/mock-github-3.0.0-beta.1.tgz", + "integrity": "sha512-6mhdp1Us5+6Y9BH8sqYiT4BWYIdbeXcLFFuyxUHmEX0zQ+U+PMGDknuTf3svZ4IfUFD67FfUK9nMRhpVAHyLsg==", "dependencies": { "@octokit/openapi-types-ghec": "^18.0.0", "ajv": "^8.11.0", "express": "^4.18.1", "fast-glob": "^3.2.12", "fs-extra": "^10.1.0", - "nock": "^13.2.7", + "nock": "14.0.0-beta.7", "simple-git": "^3.8.0", "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@kie/mock-github/node_modules/nock": { + "version": "14.0.0-beta.7", + "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.0-beta.7.tgz", + "integrity": "sha512-+EQMm5W9K8YnBE2Ceg4hnJynaCZmvK8ZlFXQ2fxGwtkOkBUq8GpQLTks2m1jpvse9XDxMDDOHgOWpiznFuh0bA==", + "dependencies": { + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + }, + "engines": { + "node": ">= 18" } }, "node_modules/@kwsites/file-exists": { @@ -5542,6 +5560,7 @@ }, "node_modules/lodash": { "version": "4.17.21", + "dev": true, "license": "MIT" }, "node_modules/lodash.capitalize": { @@ -6028,6 +6047,7 @@ }, "node_modules/nock": { "version": "13.3.0", + "dev": true, "license": "MIT", "dependencies": { "debug": "^4.1.0", @@ -11883,18 +11903,29 @@ } }, "@kie/mock-github": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@kie/mock-github/-/mock-github-2.0.0.tgz", - "integrity": "sha512-od6UyICJYKMnz9HgEWCQAFT/JsCpKkLp+JQH8fV23tf+ZmmQI1dK3C20k6aO5uJhAHA0yOcFtbKFVF4+8i3DTg==", + "version": "3.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@kie/mock-github/-/mock-github-3.0.0-beta.1.tgz", + "integrity": "sha512-6mhdp1Us5+6Y9BH8sqYiT4BWYIdbeXcLFFuyxUHmEX0zQ+U+PMGDknuTf3svZ4IfUFD67FfUK9nMRhpVAHyLsg==", "requires": { "@octokit/openapi-types-ghec": "^18.0.0", "ajv": "^8.11.0", "express": "^4.18.1", "fast-glob": "^3.2.12", "fs-extra": "^10.1.0", - "nock": "^13.2.7", + "nock": "14.0.0-beta.7", "simple-git": "^3.8.0", "totalist": "^3.0.0" + }, + "dependencies": { + "nock": { + "version": "14.0.0-beta.7", + "resolved": "https://registry.npmjs.org/nock/-/nock-14.0.0-beta.7.tgz", + "integrity": "sha512-+EQMm5W9K8YnBE2Ceg4hnJynaCZmvK8ZlFXQ2fxGwtkOkBUq8GpQLTks2m1jpvse9XDxMDDOHgOWpiznFuh0bA==", + "requires": { + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + } + } } }, "@kwsites/file-exists": { @@ -14759,7 +14790,8 @@ } }, "lodash": { - "version": "4.17.21" + "version": "4.17.21", + "dev": true }, "lodash.capitalize": { "version": "4.2.1", @@ -15084,6 +15116,7 @@ }, "nock": { "version": "13.3.0", + "dev": true, "requires": { "debug": "^4.1.0", "json-stringify-safe": "^5.0.1", diff --git a/package.json b/package.json index cf19593..d38d16e 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "typescript": "^4.7.4" }, "dependencies": { - "@kie/mock-github": "^2.0.0", + "@kie/mock-github": "^3.0.0-beta.1", "adm-zip": "^0.5.10", "ajv": "^8.12.0", "bin-links": "^4.0.1", @@ -76,6 +76,9 @@ "tar": "^6.1.13", "yaml": "^2.1.3" }, + "engines": { + "node": ">=18" + }, "jestSonar": { "reportPath": "coverage" }, diff --git a/test/ci/pull_request.test.ts b/test/ci/pull_request.test.ts index a10c7ef..d5e07a3 100644 --- a/test/ci/pull_request.test.ts +++ b/test/ci/pull_request.test.ts @@ -54,7 +54,7 @@ afterEach(async () => { test("pull request workflow", async () => { const act = new Act(github.repo.getPath("pull_request")); - const result = await act.setMatrix("node-version", ["16.x"]).runJob("unit", { + const result = await act.setMatrix("node-version", ["18.x"]).runJob("unit", { mockSteps: { unit: [ {