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

Feat/action #74

Merged
merged 12 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 41 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "GitHub Actions (TypeScript)",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",
"postCreateCommand": "npm install",
"customizations": {
"codespaces": {
"openFiles": ["README.md"]
},
"vscode": {
"extensions": [
"bierner.markdown-preview-github-styles",
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"me-dutour-mathieu.vscode-github-actions",
"redhat.vscode-yaml",
"rvest.vs-code-prettier-eslint",
"yzhang.markdown-all-in-one"
],
"settings": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.formatOnSave": true,
"markdown.extension.list.indentationSize": "adaptive",
"markdown.extension.italic.indicator": "_",
"markdown.extension.orderedList.marker": "one"
}
}
},
"remoteEnv": {
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/prettier:1": {}
}
}
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto eol=lf

dist/** -diff linguist-generated=true
36 changes: 36 additions & 0 deletions .github/workflows/ai-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ai-example

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
ai-report: true
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/ctrf-report.json
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
2 changes: 1 addition & 1 deletion .github/workflows/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Test ai report
run: node dist/core/cli.js ai ctrf-reports/ctrf-report.json --title "AI Summary"
- name: Upload test results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Test community report
run: node dist/core/cli.js community ctrf-reports/ctrf-report.json summary-short --title "Community report"
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
community-report-name: 'summary-short'
community-report: true
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/custom-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: custom-example

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
template-path: './templates/custom-report.hbs'
custom-report: true
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/ctrf-report.json
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
4 changes: 2 additions & 2 deletions .github/workflows/custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Test custom summary hbs file
run: node dist/core/cli.js custom ctrf-reports/ctrf-report.json templates/custom-summary.hbs
run: node dist/core/cli.js custom ctrf-reports/ctrf-report.json templates/custom-report.hbs
- name: Test custom summary string
run: node dist/core/cli.js custom ctrf-reports/ctrf-report.json "I'm a custom summary string!" --annotate false
- name: Upload test results
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/detailed-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: detailed-example

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
test-report: true
test-list-report: true
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/ctrf-report.json
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
2 changes: 1 addition & 1 deletion .github/workflows/detailed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Test table
run: node dist/core/cli.js tests ctrf-reports/ctrf-report.json --title "Test table"
- name: Test list
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/failed-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: failed-example

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
failed-report: true
failed-folded-report: true
fail-rate-report: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/ctrf-report.json
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
2 changes: 1 addition & 1 deletion .github/workflows/failed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Failed table
run: node dist/core/cli.js failed ctrf-reports/ctrf-report.json --title "Failed table"
- name: Failed table
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/flaky-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: flaky-exmaple

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf/*.json'
flaky-report: true
flaky-rate-report: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always()
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ctrf-report
path: ctrf-reports/ctrf-report.json
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: custom-artifact-name
path: ctrf-reports/ctrf-report-no-fails.json
2 changes: 1 addition & 1 deletion .github/workflows/flaky.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Flaky table
run: node dist/core/cli.js flaky ctrf-reports/ctrf-report.json --title "Flaky table"
- name: Flaky rate table
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/historical.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npm run build:npm
- name: Previous results table
run: node dist/core/cli.js historical ctrf-reports/ctrf-report.json --annotate false --title "Previous results table"
env:
Expand Down
44 changes: 17 additions & 27 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,25 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Summary table
run: node dist/core/cli.js summary ctrf-reports/ctrf-report.json --title "Summary table"
- name: Historical table
run: node dist/core/cli.js historical ctrf-reports/ctrf-report.json --annotate false --title "Previous results table"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Suite folded table
run: node dist/core/cli.js suite-folded ctrf-reports/ctrf-report.json --annotate false --title "Suite folded table"
- name: Failed table
run: node dist/core/cli.js failed ctrf-reports/ctrf-report.json --annotate false --title "Failed table"
- name: Failed rate table
run: node dist/core/cli.js failed-rate ctrf-reports/ctrf-report.json --annotate false --title "Fail rate table"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Failed folded table
run: node dist/core/cli.js failed-folded ctrf-reports/ctrf-report.json --annotate false --title "Fail folded table"
- name: Flaky table
run: node dist/core/cli.js flaky ctrf-reports/ctrf-report.json --annotate false --title "flaky table"
- name: Flaky rate table
run: node dist/core/cli.js flaky-rate ctrf-reports/ctrf-report.json --annotate false --title "Flaky rate table"
run: npm run all:action
- name: Publish Test Report
uses: ./
with:
report-path: './ctrf-reports/*.json'
template-path: 'templates/custom-report.hbs'
summary-report: true
previous-results-report: true
suite-folded-report: true
failed-report: true
fail-rate-report: true
failed-folded-report: true
flaky-report: true
flaky-rate-report: true
ai-report: true
skipped-report: true
custom-report: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: AI table
run: node dist/core/cli.js ai ctrf-reports/ctrf-report.json --annotate false --title "AI table"
- name: Skipped table
run: node dist/core/cli.js skipped ctrf-reports/ctrf-report.json --annotate false --title "Skipped table"
- name: Custom
run: node dist/core/cli.js custom ctrf-reports/ctrf-report.json templates/custom-summary.hbs --annotate false --title "Custom"
- name: Upload test results
uses: actions/upload-artifact@v4
with:
Expand Down
Loading
Loading