Skip to content

Commit d54d352

Browse files
committed
Test action
1 parent 6195a7e commit d54d352

File tree

4 files changed

+129
-9
lines changed

4 files changed

+129
-9
lines changed

tools/UnitTestApp/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Hello World'
2+
description: 'Greet someone and record the time'
3+
inputs:
4+
who-to-greet: # id of input
5+
description: 'Who to greet'
6+
required: true
7+
default: 'World'
8+
outputs:
9+
time: # id of output
10+
description: 'The time we greeted you'
11+
runs:
12+
using: 'node20'
13+
main: 'dist/index.js'

tools/UnitTestApp/dist/index.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/******/ (() => { // webpackBootstrap
2+
/******/ var __webpack_modules__ = ({
3+
4+
/***/ 768:
5+
/***/ ((module) => {
6+
7+
module.exports = eval("require")("@actions/core");
8+
9+
10+
/***/ }),
11+
12+
/***/ 438:
13+
/***/ ((module) => {
14+
15+
module.exports = eval("require")("@actions/github");
16+
17+
18+
/***/ })
19+
20+
/******/ });
21+
/************************************************************************/
22+
/******/ // The module cache
23+
/******/ var __webpack_module_cache__ = {};
24+
/******/
25+
/******/ // The require function
26+
/******/ function __nccwpck_require__(moduleId) {
27+
/******/ // Check if module is in cache
28+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
29+
/******/ if (cachedModule !== undefined) {
30+
/******/ return cachedModule.exports;
31+
/******/ }
32+
/******/ // Create a new module (and put it into the cache)
33+
/******/ var module = __webpack_module_cache__[moduleId] = {
34+
/******/ // no module.id needed
35+
/******/ // no module.loaded needed
36+
/******/ exports: {}
37+
/******/ };
38+
/******/
39+
/******/ // Execute the module function
40+
/******/ var threw = true;
41+
/******/ try {
42+
/******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
43+
/******/ threw = false;
44+
/******/ } finally {
45+
/******/ if(threw) delete __webpack_module_cache__[moduleId];
46+
/******/ }
47+
/******/
48+
/******/ // Return the exports of the module
49+
/******/ return module.exports;
50+
/******/ }
51+
/******/
52+
/************************************************************************/
53+
/******/ /* webpack/runtime/compat */
54+
/******/
55+
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
56+
/******/
57+
/************************************************************************/
58+
var __webpack_exports__ = {};
59+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
60+
(() => {
61+
const core = __nccwpck_require__(768);
62+
const github = __nccwpck_require__(438);
63+
64+
try {
65+
// `who-to-greet` input defined in action metadata file
66+
const nameToGreet = core.getInput('who-to-greet');
67+
console.log(`Hello ${nameToGreet}!`);
68+
const time = (new Date()).toTimeString();
69+
core.setOutput("time", time);
70+
// Get the JSON webhook payload for the event that triggered the workflow
71+
const payload = JSON.stringify(github.context.payload, undefined, 2)
72+
console.log(`The event payload: ${payload}`);
73+
} catch (error) {
74+
core.setFailed(error.message);
75+
}
76+
})();
77+
78+
module.exports = __webpack_exports__;
79+
/******/ })()
80+
;

tools/UnitTestApp/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const core = require('@actions/core');
2+
const github = require('@actions/github');
3+
4+
try {
5+
// `who-to-greet` input defined in action metadata file
6+
const nameToGreet = core.getInput('who-to-greet');
7+
console.log(`Hello ${nameToGreet}!`);
8+
const time = (new Date()).toTimeString();
9+
core.setOutput("time", time);
10+
// Get the JSON webhook payload for the event that triggered the workflow
11+
const payload = JSON.stringify(github.context.payload, undefined, 2)
12+
console.log(`The event payload: ${payload}`);
13+
} catch (error) {
14+
core.setFailed(error.message);
15+
}

tools/UnitTestApp/package.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,37 @@
1111
"test": "jest"
1212
},
1313
"devDependencies": {
14-
"jest": "29.7.0",
15-
"@types/jest": "29.5.5",
14+
"@fluentui/react-charting": "*",
15+
"@fluentui/theme-samples": "^8.7.119",
1616
"@testing-library/dom": "8.11.3",
1717
"@testing-library/jest-dom": "5.16.5",
1818
"@testing-library/react": "12.1.2",
19-
"react": "17.0.2",
20-
"react-dom": "17.0.2",
21-
"react-test-renderer": "17.0.2",
19+
"@types/fs-extra": "8.0.1",
20+
"@types/jest": "29.5.5",
21+
"@types/node": "16.11.7",
2222
"@types/react": "17.0.44",
23+
"@types/react-addons-test-utils": "0.14.18",
2324
"@types/react-dom": "17.0.15",
2425
"@types/react-test-renderer": "17.0.2",
25-
"@types/react-addons-test-utils": "0.14.18",
26+
"@types/rewire": "^2.5.28",
2627
"fs-extra": "8.1.0",
27-
"@types/fs-extra": "8.0.1",
28+
"jest": "29.7.0",
29+
"react": "17.0.2",
30+
"react-dom": "17.0.2",
31+
"react-test-renderer": "17.0.2",
2832
"rewire": "^4.0.1",
29-
"@types/rewire": "^2.5.28",
30-
"@fluentui/react-charting": "5.18.17"
33+
"typescript": "4.4.4"
3134
},
3235
"exports": {
3336
"./README.md": "./README.md"
37+
},
38+
"jest": {
39+
"setupFilesAfterEnv": [
40+
"<rootDir>/jest.setup.js"
41+
]
42+
},
43+
"dependencies": {
44+
"@actions/core": "^1.10.1",
45+
"@actions/github": "^6.0.0"
3446
}
3547
}

0 commit comments

Comments
 (0)