Skip to content

Commit b12f435

Browse files
committed
Merge main, resolve
2 parents b4c82b7 + f1edb11 commit b12f435

18 files changed

Lines changed: 632 additions & 197 deletions

.github/workflows/pr-workflow.yaml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,38 @@ jobs:
1717
run: pnpm install --frozen-lockfile
1818

1919
- name: Run checks
20-
run: pnpm check
20+
run: pnpm run check
2121

2222
- name: Run Tests
2323
run: pnpm test
2424

2525
- name: Compile Typescript
26-
run: pnpm build
26+
run: pnpm run build
27+
28+
- name: Run mabl tests (no-wait)
29+
id: mabl-test-no-wait
30+
uses: ./
31+
env:
32+
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
application-id: D6uz-lhAGBYuTTc6Jj_w0Q-a
36+
environment-id: I9tfo2dWd7WSigXcO91feA-e
37+
app-url: 'https://storage.googleapis.com/public-test-pages/uptime/canary.html'
38+
await-completion: false
39+
plan-labels: |
40+
canary
41+
42+
- name: Validate no-wait outputs
43+
run: |
44+
if [ -z "${{ steps.mabl-test-no-wait.outputs.mabl-deployment-id }}" ]; then
45+
echo "::error::mabl-deployment-id should be set when await-completion=false"
46+
exit 1
47+
fi
48+
if [ -n "${{ steps.mabl-test-no-wait.outputs.plans_run }}" ]; then
49+
echo "::error::plans_run should NOT be set when await-completion=false"
50+
exit 1
51+
fi
2752
2853
- name: Run mabl tests against deployment
2954
id: mabl-test-deployment
@@ -45,3 +70,18 @@ jobs:
4570
http-headers: |
4671
X-Test-Header-1: 1234
4772
X-Test-Header-2: 5678
73+
74+
- name: Validate wait outputs
75+
run: |
76+
if [ -z "${{ steps.mabl-test-deployment.outputs.mabl-deployment-id }}" ]; then
77+
echo "::error::mabl-deployment-id should be set when await-completion=true"
78+
exit 1
79+
fi
80+
if [ -z "${{ steps.mabl-test-deployment.outputs.plans_run }}" ]; then
81+
echo "::error::plans_run should be set when await-completion=true"
82+
exit 1
83+
fi
84+
if [ -z "${{ steps.mabl-test-deployment.outputs.tests_run }}" ]; then
85+
echo "::error::tests_run should be set when await-completion=true"
86+
exit 1
87+
fi

.github/workflows/push-workflow.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ jobs:
1818
run: pnpm install --frozen-lockfile
1919

2020
- name: Run checks
21-
run: pnpm check
21+
run: pnpm run check
2222

2323
- name: Run Tests
2424
run: pnpm test
2525

2626
- name: Compile Typescript
27-
run: pnpm build
27+
run: pnpm run build
2828

2929
- name: Run mabl tests against deployment
3030
id: mabl-test-deployment

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ typings/
6666
*.swp
6767

6868
#compiled js
69-
lib/*.js
69+
lib/*

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Releases can then be built from that branch by running
99

1010
```bash
1111
# Compile release
12-
pnpm release
12+
pnpm run release
1313

1414
# Commit the built release files
1515
git commit -m "<version, e.g. v1.4> release"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ jobs:
9595

9696
**Note**: Either `application-id` or `environment-id` must be supplied.
9797

98+
- `await-completion` {boolean} (optional) - Set to `false` to trigger tests
99+
without waiting for results. Only the `mabl-deployment-id` output will be set.
100+
Defaults to `true`.
98101
- `application-id` {string} (optional) - mabl id for the deployed application.
99102
Use the
100103
[curl builder](https://app.mabl.com/workspaces/-/settings/apis#api-docs-selector-dropdown-button)
@@ -141,6 +144,10 @@ jobs:
141144
- `tests_failed` {int32} - number of mabl tests that failed against this
142145
deployment.
143146

147+
**Note**: Metric outputs (`plans_run`, `plans_passed`, `plans_failed`,
148+
`tests_run`, `tests_passed`, `tests_failed`) are only available when
149+
`await-completion` is `true` (the default).
150+
144151

145152
## Contributing
146153

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ branding:
44
icon: play-circle
55
color: white
66
inputs:
7+
await-completion:
8+
description: 'Set to false to trigger tests without waiting for results. Only the mabl-deployment-id output will be set.'
9+
required: false
10+
default: 'true'
711
application-id:
812
description: ^
913
'Mabl id for the deployed application. You can get the id using the

jest.config.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
roots: ['<rootDir>/test'],
3+
transform: {
4+
'^.+\\.tsx?$': [
5+
'ts-jest',
6+
{
7+
useESM: true,
8+
},
9+
],
10+
},
11+
extensionsToTreatAsEsm: ['.ts'],
12+
moduleNameMapper: {
13+
'^(\\.{1,2}/.*)\\.js$': '$1',
14+
},
15+
testEnvironment: 'node',
16+
};

jest.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22
"name": "mabl-github-deployments-action",
33
"version": "1.16.0",
44
"description": "mabl github action for GitHub pipelines integration",
5+
"type": "module",
56
"main": "lib/src/entrypoint.js",
67
"scripts": {
7-
"test": "jest",
8+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest --config jest.config.cjs",
89
"build": "tsc",
9-
"release": "pnpm install --frozen-lockfile && pnpm build && pnpm prune --prod && git add -f node_modules/* && git add -f lib/*",
10+
"release": "pnpm install --frozen-lockfile && pnpm run build && pnpm prune --prod && git add -f node_modules/* && git add -f lib/*",
1011
"fix:prettier": "prettier --write 'src/**/*.ts'",
1112
"fix:eslint": "eslint 'src/**/*.ts' --fix",
12-
"fix": "pnpm fix:eslint && pnpm fix:prettier",
13+
"fix": "pnpm run fix:eslint && pnpm run fix:prettier",
1314
"check:prettier": "prettier --check 'src/**/*.ts'",
1415
"check:eslint": "eslint 'src/**/*.ts'",
15-
"check": "pnpm check:eslint && pnpm check:prettier"
16+
"check": "pnpm run check:eslint && pnpm run check:prettier"
1617
},
18+
"packageManager": "pnpm@10.34.1+sha512.b58fbde6dca66a929538021581f648b4570b6ca19b18e7cbd7f2c07a7b24454155388dacdf08f2af3678e88a6d1fe04f9d609df24bf51735a060ea041b374ab7",
1719
"author": "mabl",
1820
"dependencies": {
19-
"@actions/core": "1.11.1",
20-
"@actions/github": "6.0.0",
21+
"@actions/core": "3.0.0",
22+
"@actions/github": "9.0.0",
2123
"async-retry": "1.3.3",
2224
"axios": "1.17.0",
2325
"cli-table3": "0.6.5",
2426
"moment": "2.30.1"
2527
},
2628
"devDependencies": {
27-
"@types/async-retry": "1.4.9",
29+
"@types/async-retry": "1.4.3",
2830
"@types/jest": "29.2.0",
2931
"@types/node": "24.13.1",
3032
"@typescript-eslint/eslint-plugin": "5.19.0",
@@ -37,6 +39,5 @@
3739
"prettier": "2.6.2",
3840
"ts-jest": "29.2.5",
3941
"typescript": "5.7.2"
40-
},
41-
"packageManager": "pnpm@10.34.1+sha512.b58fbde6dca66a929538021581f648b4570b6ca19b18e7cbd7f2c07a7b24454155388dacdf08f2af3678e88a6d1fe04f9d609df24bf51735a060ea041b374ab7"
42+
}
4243
}

0 commit comments

Comments
 (0)