Skip to content

Commit d0b2846

Browse files
committed
Added download urls
1 parent 7764284 commit d0b2846

File tree

12 files changed

+465
-170
lines changed

12 files changed

+465
-170
lines changed

CODEOWNERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
# Repository CODEOWNERS
2-
3-
* @actions/actions-oss-maintainers

__tests__/main.test.ts

Lines changed: 16 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -6,84 +6,36 @@
66
* variables following the pattern `INPUT_<INPUT_NAME>`.
77
*/
88

9-
import * as core from '@actions/core'
9+
//import * as core from '@actions/core'
1010
import * as main from '../src/main'
11+
import fetchMock from 'jest-fetch-mock'
1112

1213
// Mock the action's main function
1314
const runMock = jest.spyOn(main, 'run')
1415

15-
// Other utilities
16-
const timeRegex = /^\d{2}:\d{2}:\d{2}/
17-
1816
// Mock the GitHub Actions core library
19-
let debugMock: jest.SpiedFunction<typeof core.debug>
20-
let errorMock: jest.SpiedFunction<typeof core.error>
21-
let getInputMock: jest.SpiedFunction<typeof core.getInput>
22-
let setFailedMock: jest.SpiedFunction<typeof core.setFailed>
23-
let setOutputMock: jest.SpiedFunction<typeof core.setOutput>
17+
// let debugMock: jest.SpiedFunction<typeof core.debug>
18+
// let errorMock: jest.SpiedFunction<typeof core.error>
19+
// let getInputMock: jest.SpiedFunction<typeof core.getInput>
20+
// let setFailedMock: jest.SpiedFunction<typeof core.setFailed>
21+
//let setOutputMock: jest.SpiedFunction<typeof core.setOutput>
22+
23+
fetchMock.enableMocks()
2424

2525
describe('action', () => {
2626
beforeEach(() => {
2727
jest.clearAllMocks()
28+
fetchMock.resetMocks()
2829

29-
debugMock = jest.spyOn(core, 'debug').mockImplementation()
30-
errorMock = jest.spyOn(core, 'error').mockImplementation()
31-
getInputMock = jest.spyOn(core, 'getInput').mockImplementation()
32-
setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation()
33-
setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
34-
})
35-
36-
it('sets the time output', async () => {
37-
// Set the action's inputs as return values from core.getInput()
38-
getInputMock.mockImplementation(name => {
39-
switch (name) {
40-
case 'milliseconds':
41-
return '500'
42-
default:
43-
return ''
44-
}
45-
})
46-
47-
await main.run()
48-
expect(runMock).toHaveReturned()
49-
50-
// Verify that all of the core library functions were called correctly
51-
expect(debugMock).toHaveBeenNthCalledWith(1, 'Waiting 500 milliseconds ...')
52-
expect(debugMock).toHaveBeenNthCalledWith(
53-
2,
54-
expect.stringMatching(timeRegex)
55-
)
56-
expect(debugMock).toHaveBeenNthCalledWith(
57-
3,
58-
expect.stringMatching(timeRegex)
59-
)
60-
expect(setOutputMock).toHaveBeenNthCalledWith(
61-
1,
62-
'time',
63-
expect.stringMatching(timeRegex)
64-
)
65-
expect(errorMock).not.toHaveBeenCalled()
30+
// debugMock = jest.spyOn(core, 'debug').mockImplementation()
31+
// errorMock = jest.spyOn(core, 'error').mockImplementation()
32+
// getInputMock = jest.spyOn(core, 'getInput').mockImplementation()
33+
// setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation()
34+
//setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation()
6635
})
6736

68-
it('sets a failed status', async () => {
69-
// Set the action's inputs as return values from core.getInput()
70-
getInputMock.mockImplementation(name => {
71-
switch (name) {
72-
case 'milliseconds':
73-
return 'this is not a number'
74-
default:
75-
return ''
76-
}
77-
})
78-
37+
it('should run', async () => {
7938
await main.run()
8039
expect(runMock).toHaveReturned()
81-
82-
// Verify that all of the core library functions were called correctly
83-
expect(setFailedMock).toHaveBeenNthCalledWith(
84-
1,
85-
'milliseconds not a number'
86-
)
87-
expect(errorMock).not.toHaveBeenCalled()
8840
})
8941
})

__tests__/wait.test.ts

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

action.yml

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
name: 'The name of your action here'
2-
description: 'Provide a description here'
3-
author: 'Your name or organization here'
1+
name: 'Deploy Qt Creator Extension'
2+
description: 'Deploys a Qt Creator Extension to the Qt Creator Extension Store'
3+
author: 'The Qt Company'
44

55
# Add your action's branding here. This will appear on the GitHub Marketplace.
66
branding:
77
icon: 'heart'
8-
color: 'red'
8+
color: 'green'
99

1010
# Define your inputs here.
1111
inputs:
12-
milliseconds:
13-
description: 'Your input description here'
12+
spec:
13+
description: 'Path to the plugin spec'
1414
required: true
15-
default: '1000'
15+
api:
16+
description: 'Path to the Extension store api'
17+
required: true
18+
token:
19+
description: 'Your API Token for the Extension Store'
20+
required: true
21+
download-url-win-x64:
22+
description: 'The url to download the extension from (for Windows x64)'
23+
required: true
24+
download-url-win-arm:
25+
description: 'The url to download the extension from (for Windows ARM64)'
26+
required: true
27+
download-url-macos:
28+
description: 'The url to download the extension from (for macOS Universal)'
29+
required: true
30+
download-url-linux-x64:
31+
description: 'The url to download the extension from (for Linux x64)'
32+
required: true
33+
download-url-linux-arm:
34+
description: 'The url to download the extension from (for Linux ARM64)'
35+
required: true
36+
publish:
37+
description: 'Whether to immediately set status to "published"'
38+
required: false
39+
default: 'false'
1640

1741
# Define your outputs here.
18-
outputs:
19-
time:
20-
description: 'Your output description here'
42+
#outputs:
43+
# time:
44+
# description: 'Your output description here'
2145

2246
runs:
2347
using: node20

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 138 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)