Compare commits

...

8 Commits

Author SHA1 Message Date
Shohei Ueda
bacd27d8e5
Merge 28797ce1ee into 3b443076f0 2024-11-06 01:31:54 +09:00
dependabot[bot]
3b443076f0
ci: bump peaceiris/actions-hugo from 2.6.0 to 3.0.0 (#653)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 12:39:54 +09:00
dependabot[bot]
764796d276
ci: bump actions/upload-artifact from 3 to 4 (#654)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 12:39:40 +09:00
dependabot[bot]
e177dc33cb
ci: bump codecov/codecov-action from 3 to 4 (#655)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 12:39:29 +09:00
dependabot[bot]
711df4ed64
ci: bump actions/dependency-review-action from 3 to 4 (#656)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 12:39:13 +09:00
dependabot[bot]
9d57878417
ci: bump github/codeql-action from 2 to 3 (#657)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 11:57:05 +09:00
Shohei Ueda
28797ce1ee
test: fix 2020-07-17 15:56:07 +09:00
Shohei Ueda
cef7a7b43d
feat: throw error for invalid extended input 2020-07-17 15:49:02 +09:00
6 changed files with 13 additions and 11 deletions

View File

@ -13,12 +13,12 @@ jobs:
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

View File

@ -13,4 +13,4 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/dependency-review-action@v3
- uses: actions/dependency-review-action@v4

View File

@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2.6.0
uses: peaceiris/actions-hugo@v3.0.0
with:
hugo-version: ${{ matrix.hugo-version }}
extended: ${{ matrix.extended }}

View File

@ -47,9 +47,9 @@ jobs:
- run: npm test
- name: Upload test coverage as artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}
path: coverage
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4

View File

@ -25,6 +25,7 @@ describe('Integration testing run()', () => {
test('succeed in installing a custom version', async () => {
const testVersion = Tool.TestVersionSpec;
process.env['INPUT_HUGO-VERSION'] = testVersion;
process.env['INPUT_EXTENDED'] = 'false';
const result: main.ActionResult = await main.run();
expect(result.exitcode).toBe(0);
expect(result.output).toMatch(`hugo v${testVersion}`);
@ -43,6 +44,7 @@ describe('Integration testing run()', () => {
test('succeed in installing the latest version', async () => {
const testVersion = 'latest';
process.env['INPUT_HUGO-VERSION'] = testVersion;
process.env['INPUT_EXTENDED'] = 'false';
nock('https://formulae.brew.sh').get(`/api/formula/${Tool.Repo}.json`).reply(200, jsonTestBrew);
const result: main.ActionResult = await main.run();
expect(result.exitcode).toBe(0);
@ -62,8 +64,8 @@ describe('Integration testing run()', () => {
test('fail to install the latest version due to 404 of brew', async () => {
process.env['INPUT_HUGO-VERSION'] = 'latest';
process.env['INPUT_EXTENDED'] = 'false';
nock('https://formulae.brew.sh').get(`/api/formula/${Tool.Repo}.json`).reply(404);
await expect(main.run()).rejects.toThrowError(FetchError);
});
});

View File

@ -7,10 +7,10 @@ export default function getURL(
const extendedStr = (extended: string): string => {
if (extended === 'true') {
return 'extended_';
} else {
} else if (extended === 'false') {
return '';
// } else {
// throw new Error(`Invalid input (extended): ${extended}`);
} else {
throw new Error(`Invalid input (extended): ${extended}`);
}
};