Skip to content
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

Reports CI #221

Merged
merged 37 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b4bd447
add client switch
softmarshmallow Jun 19, 2023
f3b910d
wip - adding progress
softmarshmallow Jun 19, 2023
a052fde
mv
softmarshmallow Jun 19, 2023
00b74a4
add report bin cli
softmarshmallow Jun 19, 2023
b023e5a
optional env config
softmarshmallow Jun 19, 2023
1addc91
fix reports
softmarshmallow Jun 19, 2023
97b99b3
add ci reports
softmarshmallow Jun 19, 2023
5672674
add codetest report workflow
softmarshmallow Jun 19, 2023
3252154
update uses
softmarshmallow Jun 19, 2023
867c1b4
fix path resolution
softmarshmallow Jun 19, 2023
553bb58
split
softmarshmallow Jun 19, 2023
9975368
Update Bucket name
softmarshmallow Jun 19, 2023
0f0dfee
split node report
softmarshmallow Jun 19, 2023
c14b7bd
Merge branch 'wip' of https://github.com/gridaco/designto-code into wip
softmarshmallow Jun 19, 2023
ee6c494
split file report
softmarshmallow Jun 19, 2023
9a7ef88
add multi page queue support for screenshot worker
softmarshmallow Jun 20, 2023
b946904
faster report generation
softmarshmallow Jun 20, 2023
efc6789
even faster report generation with nested concurrency and direct scre…
softmarshmallow Jun 20, 2023
a5906d6
improved logging & concurrency adjustment
softmarshmallow Jun 20, 2023
2f04d10
action steps split
softmarshmallow Jun 20, 2023
88a43e5
split files
softmarshmallow Jun 20, 2023
cc94038
split
softmarshmallow Jun 20, 2023
c496ea8
adjust pupeteer concurrency and performance benchmark test
softmarshmallow Jun 21, 2023
376ba3b
add multiple workers for better performance
softmarshmallow Jun 21, 2023
27acf27
opt
softmarshmallow Jul 5, 2023
cb5648e
update samples
softmarshmallow Jul 5, 2023
7dfa980
Merge branch 'main' of https://github.com/gridaco/designto-code into wip
softmarshmallow Jul 7, 2023
f8ba05f
add report ci modes
softmarshmallow Jul 7, 2023
5e786a1
update dest and trigger
softmarshmallow Jul 7, 2023
97a866a
update dirs
softmarshmallow Jul 7, 2023
7f608ac
fix json
softmarshmallow Jul 7, 2023
44d82c3
add comment
softmarshmallow Jul 7, 2023
1ea3605
update comment
softmarshmallow Jul 7, 2023
2f18e73
fix comment
softmarshmallow Jul 7, 2023
f98f10c
fix comment
softmarshmallow Jul 7, 2023
7778ba3
fix comment
softmarshmallow Jul 7, 2023
4091531
trigger ci
softmarshmallow Nov 10, 2023
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
49 changes: 49 additions & 0 deletions .github/workflows/codetest-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "@codetest/report"

on:
release:
types: [published]
pull_request:
types: [opened, synchronize, closed]

jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: setup
run: |
yarn --frozen-lockfile
- name: build report tools
working-directory: testing/report
run: |
yarn build
- name: run report
id: report
working-directory: ci/report
run: |
npm ci
node report.js
- name: upload report to s3
id: upload
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: "codetest-reports"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_S3_CODETEST_REPORTS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_S3_CODETEST_REPORTS }}
AWS_REGION: "us-west-1"
SOURCE_DIR: "ci/report/.coverage"
# dest dir is commit hash
DEST_DIR: "${{ github.sha }}"
- name: comment
id: comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STATUS: ${{ steps.report.outputs.STATUS }}
working-directory: ci/report
run: |
npm ci
node comment.js
1 change: 1 addition & 0 deletions ci/report/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.coverage*
3 changes: 3 additions & 0 deletions ci/report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Reports Generating

This modules enables reports generation based on the current engine, enabling developers to visually track the engine features visually, by comparing the generated outputs, compared using vision diff.
31 changes: 31 additions & 0 deletions ci/report/comment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const github = require("@actions/github");
const octokit = github.getOctokit(process.env.GITHUB_TOKEN);
const context = github.context;
const { sha } = context;

const report_url = `https://code.grida.co/tests/reports/${sha}`;

let message;

if (context.payload.pull_request && context.eventName === "pull_request") {
const conclusion = process.env.STATUS || "unknown";

switch (conclusion) {
case "success":
message = `Report available at ${report_url} :tada:`;
break;
case "failure":
message = "Your PR failed some tests :x:";
break;
case "skipped":
case "unknown":
break;
}

// add a comment to the PR
octokit.rest.issues.createComment({
...context.repo,
issue_number: context.payload.pull_request.number,
body: message,
});
}
7 changes: 7 additions & 0 deletions ci/report/configs/report.config.max.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require("path");

module.exports = {
sample: path.join(__dirname, "../samples-50.json"),
outDir: path.join(__dirname, "../.coverage"),
skipIfReportExists: false,
};
7 changes: 7 additions & 0 deletions ci/report/configs/report.config.med.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require("path");

module.exports = {
sample: path.join(__dirname, "../samples-10.json"),
outDir: path.join(__dirname, "../.coverage"),
skipIfReportExists: false,
};
7 changes: 7 additions & 0 deletions ci/report/configs/report.config.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require("path");

module.exports = {
sample: path.join(__dirname, "../samples-5.json"),
outDir: path.join(__dirname, "../.coverage"),
skipIfReportExists: false,
};
Loading
Loading