mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-25 20:32:19 +01:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95afbe8abf | ||
|
|
8f7332cde6 | ||
|
|
699805b6e1 | ||
|
|
2550d0ecb0 | ||
|
|
692ded2284 | ||
|
|
e9732216ce | ||
|
|
3315ca857b | ||
|
|
8d85402748 | ||
|
|
b4a0e8ba60 | ||
|
|
66d664bedd | ||
|
|
87e38e224d | ||
|
|
4fb2901627 | ||
|
|
7a50ddc694 | ||
|
|
b55f1c81fb | ||
|
|
0311892edd | ||
|
|
94ce32ea1b | ||
|
|
3317963a65 | ||
|
|
a79f520add | ||
|
|
b6a7551978 | ||
|
|
490ff3b995 |
1
.github/workflows/stale.yml
vendored
1
.github/workflows/stale.yml
vendored
@@ -15,3 +15,4 @@ jobs:
|
|||||||
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
stale-pr-message: 'This pull request is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
|
||||||
days-before-stale: 21
|
days-before-stale: 21
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
|
operations-per-run: 1
|
||||||
|
|||||||
7
.github/workflows/test-action.yml
vendored
7
.github/workflows/test-action.yml
vendored
@@ -30,4 +30,9 @@ jobs:
|
|||||||
hugo-version: ${{ matrix.hugo-version }}
|
hugo-version: ${{ matrix.hugo-version }}
|
||||||
extended: ${{ matrix.extended }}
|
extended: ${{ matrix.extended }}
|
||||||
|
|
||||||
- run: hugo version
|
- name: Run hugo version
|
||||||
|
run: echo "::set-output name=hugo_version::$(hugo version)"
|
||||||
|
id: hugo_version
|
||||||
|
|
||||||
|
- name: '${{ steps.hugo_version.outputs.hugo_version }}'
|
||||||
|
run: echo '${{ steps.hugo_version.outputs.hugo_version }}'
|
||||||
|
|||||||
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -76,14 +76,18 @@ jobs:
|
|||||||
name: coverage
|
name: coverage
|
||||||
path: coverage
|
path: coverage
|
||||||
|
|
||||||
- name: Upload test coverage to Coveralls
|
- uses: codecov/codecov-action@v1
|
||||||
uses: coverallsapp/github-action@v1.0.1
|
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
parallel: true
|
|
||||||
|
|
||||||
- name: Coveralls Finished
|
# - name: Upload test coverage to Coveralls
|
||||||
uses: coverallsapp/github-action@v1.0.1
|
# uses: coverallsapp/github-action@v1.0.1
|
||||||
with:
|
# with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
# github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
parallel-finished: true
|
# parallel: true
|
||||||
|
|
||||||
|
# - name: Coveralls Finished
|
||||||
|
# uses: coverallsapp/github-action@v1.0.1
|
||||||
|
# with:
|
||||||
|
# github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# parallel-finished: true
|
||||||
|
|||||||
37
CHANGELOG.md
37
CHANGELOG.md
@@ -2,6 +2,43 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.4.2](https://github.com/peaceiris/actions-hugo/compare/v2.4.1...v2.4.2) (2020-01-23)
|
||||||
|
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* Add codecov/codecov-action@v1 (#136) ([94ce32e](https://github.com/peaceiris/actions-hugo/commit/94ce32ea1b2965037ef7bbec618476ed6ad7b9e6)), closes [#136](https://github.com/peaceiris/actions-hugo/issues/136)
|
||||||
|
* Add Hugo version dump step ([7a50ddc](https://github.com/peaceiris/actions-hugo/commit/7a50ddc6941e49c88a35080315a84a684c825347))
|
||||||
|
* Add operations-per-run 1 ([b6a7551](https://github.com/peaceiris/actions-hugo/commit/b6a75519788da01712462416009e656ec0b9cc8d))
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @types/jest from 24.9.0 to 24.9.1 ([2550d0e](https://github.com/peaceiris/actions-hugo/commit/2550d0ecb023988fa8061c6270a46e9d67bb84dc))
|
||||||
|
* bump @types/node from 13.1.8 to 13.5.0 ([8d85402](https://github.com/peaceiris/actions-hugo/commit/8d854027489e6b4b9130701c3a826185aca6bfae))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.16.0 to 2.17.0 ([66d664b](https://github.com/peaceiris/actions-hugo/commit/66d664bedd9b4a5d5004dc4023557305c4d69d97))
|
||||||
|
* bump @typescript-eslint/parser from 2.16.0 to 2.17.0 (#144) ([692ded2](https://github.com/peaceiris/actions-hugo/commit/692ded22845285c58250414c6389365f01229c49)), closes [#144](https://github.com/peaceiris/actions-hugo/issues/144)
|
||||||
|
* bump husky from 4.0.10 to 4.2.1 ([e973221](https://github.com/peaceiris/actions-hugo/commit/e9732216ceb5db53dac31f61b0bb7d03db346f3a))
|
||||||
|
* bump jest and ts-jest ([3315ca8](https://github.com/peaceiris/actions-hugo/commit/3315ca857b7ee10f6c9de622898e44583fd81132))
|
||||||
|
* bump jest-circus from 24.9.0 to 25.1.0 ([b4a0e8b](https://github.com/peaceiris/actions-hugo/commit/b4a0e8ba604f9aeccee1f7b409870b3605de8544))
|
||||||
|
* bump lint-staged from 10.0.0 to 10.0.2 ([87e38e2](https://github.com/peaceiris/actions-hugo/commit/87e38e224d4a8f50a19dc9904c0bb85f707197bd))
|
||||||
|
* bump standard-version from 7.0.1 to 7.1.0 (#145) ([699805b](https://github.com/peaceiris/actions-hugo/commit/699805b6e156fb30665896aa7c1cbbca130a1364)), closes [#145](https://github.com/peaceiris/actions-hugo/issues/145)
|
||||||
|
* update ([3317963](https://github.com/peaceiris/actions-hugo/commit/3317963a656646a401fcf4d1420b50f5908e3be0))
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* Add Codecov badge ([0311892](https://github.com/peaceiris/actions-hugo/commit/0311892edd4e91aac6a95a003243e44ad3a54fe0))
|
||||||
|
* Update action execution time ([a79f520](https://github.com/peaceiris/actions-hugo/commit/a79f520addd8c317fcb9b29e8ecc4a8b0ecc43ae))
|
||||||
|
|
||||||
|
### style
|
||||||
|
|
||||||
|
* remove extra whitespace [skip ci] ([4fb2901](https://github.com/peaceiris/actions-hugo/commit/4fb290162762a7f823fcab1984966da8d8aed547))
|
||||||
|
|
||||||
|
### test
|
||||||
|
|
||||||
|
* Add fail to fetch latest due to 404 (#137) ([b55f1c8](https://github.com/peaceiris/actions-hugo/commit/b55f1c81fb24bc6149b3a7ec4cb9aa6c9596e877)), closes [#137](https://github.com/peaceiris/actions-hugo/issues/137)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.4.1](https://github.com/peaceiris/actions-hugo/compare/v2.4.0...v2.4.1) (2020-01-18)
|
## [2.4.1](https://github.com/peaceiris/actions-hugo/compare/v2.4.0...v2.4.1) (2020-01-18)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
[](https://github.com/peaceiris/actions-hugo/releases)
|
[](https://github.com/peaceiris/actions-hugo/releases)
|
||||||

|

|
||||||
[](https://www.codefactor.io/repository/github/peaceiris/actions-hugo)
|
[](https://www.codefactor.io/repository/github/peaceiris/actions-hugo)
|
||||||
[](https://coveralls.io/github/peaceiris/actions-hugo?branch=master)
|
[](https://codecov.io/gh/peaceiris/actions-hugo)
|
||||||
|
|
||||||
<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">
|
<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ This **Hugo Setup Action** can install **Hugo** to a virtual machine of **GitHub
|
|||||||
|
|
||||||
From `v2`, this Hugo Setup Action has migrated to a JavaScript (TypeScript) action.
|
From `v2`, this Hugo Setup Action has migrated to a JavaScript (TypeScript) action.
|
||||||
We no longer build or pull a Hugo docker image.
|
We no longer build or pull a Hugo docker image.
|
||||||
Thanks to this change, we can complete this action less than **1 sec**.
|
Thanks to this change, we can complete this action in less than a few seconds.
|
||||||
(A docker base action was taking about 1 min or more execution time to build and pull a docker image.)
|
(A docker base action was taking about 1 min or more execution time to build and pull a docker image.)
|
||||||
|
|
||||||
| OS (runs-on) | ubuntu-18.04 | macos-latest | windows-2019 |
|
| OS (runs-on) | ubuntu-18.04 | macos-latest | windows-2019 |
|
||||||
|
|||||||
@@ -3,25 +3,23 @@ import * as io from '@actions/io';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import nock from 'nock';
|
import nock from 'nock';
|
||||||
import {Tool, Action} from '../src/constants';
|
import {Tool, Action} from '../src/constants';
|
||||||
// import {FetchError} from 'node-fetch';
|
import {FetchError} from 'node-fetch';
|
||||||
import jsonTestBrew from './data/brew.json';
|
import jsonTestBrew from './data/brew.json';
|
||||||
// import jsonTestGithub from './data/github.json';
|
// import jsonTestGithub from './data/github.json';
|
||||||
|
|
||||||
jest.setTimeout(30000);
|
jest.setTimeout(30000);
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
jest.resetModules();
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
delete process.env['INPUT_HUGO-VERSION'];
|
|
||||||
nock.cleanAll();
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Integration testing run()', () => {
|
describe('Integration testing run()', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.resetModules();
|
||||||
|
});
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
const workDir = path.join(`${process.env.HOME}`, Action.WorkDirName);
|
const workDir = path.join(`${process.env.HOME}`, Action.WorkDirName);
|
||||||
await io.rmRF(workDir);
|
await io.rmRF(workDir);
|
||||||
|
|
||||||
|
delete process.env['INPUT_HUGO-VERSION'];
|
||||||
|
nock.cleanAll();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('succeed in installing a custom version', async () => {
|
test('succeed in installing a custom version', async () => {
|
||||||
@@ -69,6 +67,15 @@ describe('Integration testing run()', () => {
|
|||||||
);
|
);
|
||||||
expect(result.output).toMatch(`extended`);
|
expect(result.output).toMatch(`extended`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('fail to install the latest version due to 404 of brew', async () => {
|
||||||
|
process.env['INPUT_HUGO-VERSION'] = 'latest';
|
||||||
|
nock('https://formulae.brew.sh')
|
||||||
|
.get(`/api/formula/${Tool.Repo}.json`)
|
||||||
|
.reply(404);
|
||||||
|
|
||||||
|
await expect(main.run()).rejects.toThrowError(FetchError);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('showVersion()', () => {
|
describe('showVersion()', () => {
|
||||||
|
|||||||
@@ -1026,7 +1026,7 @@ function run() {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
core.setFailed(`Action failed with error ${e}`);
|
core.setFailed(`Action failed with error ${e}`);
|
||||||
return e;
|
throw e;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
7517
package-lock.json
generated
7517
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hugo-action",
|
"name": "hugo-action",
|
||||||
"version": "2.4.1",
|
"version": "2.4.2",
|
||||||
"description": "GitHub Actions for Hugo",
|
"description": "GitHub Actions for Hugo",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -25,8 +25,7 @@
|
|||||||
"src/**/*.ts": [
|
"src/**/*.ts": [
|
||||||
"prettier --check",
|
"prettier --check",
|
||||||
"eslint",
|
"eslint",
|
||||||
"jest --bail --findRelatedTests",
|
"jest --bail --findRelatedTests"
|
||||||
"git add"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -55,22 +54,22 @@
|
|||||||
"node-fetch": "^2.6.0"
|
"node-fetch": "^2.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^24.9.0",
|
"@types/jest": "^24.9.1",
|
||||||
"@types/node": "^13.1.7",
|
"@types/node": "^13.5.0",
|
||||||
"@types/node-fetch": "^2.5.4",
|
"@types/node-fetch": "^2.5.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.16.0",
|
"@typescript-eslint/eslint-plugin": "^2.17.0",
|
||||||
"@typescript-eslint/parser": "^2.16.0",
|
"@typescript-eslint/parser": "^2.17.0",
|
||||||
"@zeit/ncc": "^0.21.0",
|
"@zeit/ncc": "^0.21.0",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-plugin-jest": "^23.6.0",
|
"eslint-plugin-jest": "^23.6.0",
|
||||||
"husky": "^4.0.10",
|
"husky": "^4.2.1",
|
||||||
"jest": "^24.9.0",
|
"jest": "^25.1.0",
|
||||||
"jest-circus": "^24.9.0",
|
"jest-circus": "^25.1.0",
|
||||||
"lint-staged": "^9.5.0",
|
"lint-staged": "^10.0.2",
|
||||||
"nock": "^11.7.2",
|
"nock": "^11.7.2",
|
||||||
"prettier": "1.19.1",
|
"prettier": "1.19.1",
|
||||||
"standard-version": "^7.0.1",
|
"standard-version": "^7.1.0",
|
||||||
"ts-jest": "^24.3.0",
|
"ts-jest": "^25.0.0",
|
||||||
"typescript": "^3.7.5"
|
"typescript": "^3.7.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,6 @@ export async function run(): Promise<ActionResult> {
|
|||||||
return result;
|
return result;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
core.setFailed(`Action failed with error ${e}`);
|
core.setFailed(`Action failed with error ${e}`);
|
||||||
return e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user