Skip to content

feat: allow specifying expected images directory #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
46d2f41
Merge pull request #101 from reg-viz/develop
bokuweb Nov 8, 2023
7be492e
Update README.md
bokuweb Nov 10, 2023
b132106
fix: 103 (#104)
bokuweb Nov 27, 2023
f208879
fix: comment (#105)
bokuweb Dec 4, 2023
8d03dcc
feat: comment-report-format option allow to summarize changed file co…
krrrr38 Mar 15, 2024
c2e769a
fix: `The disable-branch option is not working` (#112)
bokuweb Mar 23, 2024
13a0f25
fix: report generation (#113)
bokuweb Mar 23, 2024
3caac14
deps: update (#114)
bokuweb Mar 23, 2024
4044061
build(deps): bump follow-redirects from 1.15.2 to 1.15.4 (#106)
dependabot[bot] Mar 23, 2024
063fb5e
Delete yarn.lock
bokuweb Mar 23, 2024
6e120c2
build(deps): bump undici from 5.28.3 to 5.28.4 (#120)
dependabot[bot] Apr 6, 2024
2946896
fix: 118 (#121)
bokuweb Apr 6, 2024
2d40618
fix: #118 (#122)
bokuweb Apr 6, 2024
274a9e9
feat: add cleanup workspace directory (#124)
amyu Apr 11, 2024
ad682ee
handle: error (#125)
bokuweb Apr 11, 2024
d842f5a
fix: handle comment size limitation (#126)
bokuweb Apr 11, 2024
6c08bb3
Update comment.ts (#128)
bokuweb Apr 12, 2024
1f728e8
chore: add logs (#129)
bokuweb Apr 26, 2024
07e2ac8
chore: add logs (#130)
bokuweb Apr 26, 2024
d27989e
chore: update deps (#131)
bokuweb Apr 26, 2024
4fea723
feat: add link for artifact (#133)
bokuweb Apr 30, 2024
95ecd3b
deps: update deps (#132)
bokuweb Apr 30, 2024
19d3918
fix: use artifact client for download (#135)
bokuweb Apr 30, 2024
9b3f8b6
Revert "fix: use artifact client for download (#135)" (#136)
bokuweb Apr 30, 2024
62a33a9
feat: outdated comment action option to minimize previous reg-action …
krrrr38 May 16, 2024
1dda79c
feat: Support retention days (#139)
bokuweb May 26, 2024
6d7e3f6
green keep (#140)
bokuweb Jun 1, 2024
ab748c9
fix retention-days input parameter (#141)
krrrr38 Jun 8, 2024
71f1e12
chore: add log (#142)
bokuweb Jun 11, 2024
3dd0148
fix: use for (#143)
bokuweb Jun 11, 2024
b0cff16
fix (#144)
bokuweb Jun 17, 2024
60a8105
fix: replace client (#145)
bokuweb Jun 18, 2024
763bf67
Revert "fix: replace client (#145)" (#146)
bokuweb Jun 18, 2024
a3de932
fix: threshold-pixel param default overrides threshold-rate (#147)
kopancek Jun 25, 2024
33fa4d6
feat: allow specifying expected images directory
kopancek Jun 26, 2024
5446fbb
add missing property into action.yml
kopancek Jun 26, 2024
2a06b30
revert back to using targetRun parameter
kopancek Jul 4, 2024
ea28921
fix validation of expectedImagesDirectoryPath
kopancek Jul 4, 2024
675c22b
do not allow empty expectedImagesDirectoryPath if it's defined
kopancek Jul 4, 2024
10e35f9
Remove `allowEmpty` from `validateImageDirPath`
kopancek Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
image-directory-path: "./images"
disable-branch: true
report-file-path: './'
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

### Action inputs

Input definitions are written in [action.yml](./action.yml).
Input definitions are written in [action.yml](https://github.com/reg-viz/reg-actions/blob/main/dist/action.yml).

#### `github-token` (Required)

Expand All @@ -87,7 +87,17 @@ It is used to upload test report and add comment to pull request.
- Type: String
- Default: N/A

Path to images directory.The images stored in this directory will be compared with the expected images from the last upload.
Path to images directory. The images stored in this directory will be compared with the expected images from the last upload.

#### `expected-images-directory-path` (Optional)

- Type: String
- Default: N/A

Path to expected images directory. These images will be compared with images stored in `image-directory-path`.

If this option is specified, images from artifact upload are ignored.
Instead, the images are copied directly from the specified directory.

#### `enable-antialias` (Optional)

Expand Down Expand Up @@ -165,6 +175,26 @@ Default is "reg_actions".

The option to disable push to a branch. When set to false, the `branch` option is ignored, and images will not be displayed in the comments.

#### `comment-report-format` (Optional)

- Type: String
- Default: `"raw"`

The option how to render changed file in comment. This action will change PR and workflow summary report format. Available options are `raw` and `summarized`. `raw` will render report comment with expanded results. `summarized` will render report comment using `<details>` tag to summarize by changed files.

#### `outdated-comment-action` (Optional)

- Type: String
- Default: `"none"`

The option to handle outdated comments in the PR. Available options are `none` and `minimize`. `none` do nothing. `minimize` will minimize outdated action comments.

### `retention-days` (Optional)

- Type: number
- Default: `30`

This option allows you to specify the duration for which images are stored in the branch. If not specified, the default is 30 days.

## Limitation

Expand Down
14 changes: 13 additions & 1 deletion dist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
image-directory-path:
description: "Path to images directory.The images stored in this directory will be compared with the expected images from the last upload."
required: true
expected-images-directory-path:
description: "Path to expected images directory. The images stored in this directory will be compared with the actual images from image-directory-path."
required: false
enable-antialias:
description: "Enable antialias. If omitted false."
required: false
Expand Down Expand Up @@ -40,7 +43,16 @@ inputs:
required: false
report-file-path:
description: "Path of the generated report html file. This file can be deployed in other Actions steps, but is not included in the artifact. If omitted, no html report is generated."
required: false
required: false
comment-report-format:
description: "The option how to render changed file in comment. `raw` by default."
required: false
outdated-comment-action:
description: "The option to handle outdated comments. `none` by default."
required: false
retention-days:
description: "This option allows you to specify the duration for which images are stored in the branch. If not specified, the default is 30 days."
required: false
runs:
using: "node20"
main: "lib/index.js"
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,32 @@
}
},
"dependencies": {
"@actions/artifact": "^1.1.0",
"@actions/core": "^1.10.0",
"@actions/artifact": "^2.1.7",
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/io": "^1.1.2",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@types/glob": "^8.0.0",
"adm-zip": "^0.5.9",
"axios": "^1.1.3",
"chalk": "^5.1.2",
"cpy": "^10.1.0",
"exponential-backoff": "^3.1.0",
"fast-glob": "^3.3.1",
"glob": "^8.0.3",
"loglevel": "^1.8.0",
"make-dir": "^3.1.0",
"reg-cli": "^0.17.7"
"@types/glob": "^8.1.0",
"adm-zip": "^0.5.14",
"axios": "^1.7.2",
"chalk": "^5.3.0",
"cpy": "^11.0.1",
"exponential-backoff": "^3.1.1",
"fast-glob": "^3.3.2",
"glob": "^10.4.1",
"loglevel": "^1.9.1",
"make-dir": "^4.0.0",
"reg-cli": "^0.18.6"
},
"devDependencies": {
"@octokit/openapi-types": "^19.0.0",
"@types/adm-zip": "^0.5.0",
"@octokit/openapi-types": "^22.2.0",
"@types/adm-zip": "^0.5.5",
"@types/axios": "^0.14.0",
"@types/loglevel": "^1.6.3",
"@types/make-dir": "^2.1.0",
"@types/node": "^18.11.5",
"@vercel/ncc": "^0.34.0",
"typescript": "^4.8.4"
"@types/node": "^20.13.0",
"@vercel/ncc": "^0.38.1",
"typescript": "^5.4.5"
}
}
Loading
Loading