Skip to content

Commit

Permalink
Import action-surefire-report
Browse files Browse the repository at this point in the history
Import v1.6.2 (7263a78) used in Trino. This version is using a more
efficient, native XML parsing library.
  • Loading branch information
nineinchnick committed Sep 10, 2024
1 parent fff5cf4 commit e5cd438
Show file tree
Hide file tree
Showing 48 changed files with 30,278 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/action-surefire-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: action-surefire-report

on:
push:
paths:
- 'action-surefire-report/**'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
defaults:
run:
working-directory: ./action-surefire-report
steps:
- uses: actions/checkout@v3

# generate artifacts used for tests
- uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'temurin'
cache: 'maven'
- run: |
cd tests && mvn clean test --batch-mode -Dmaven.test.failure.ignore=true
- uses: ./action-surefire-report
if: github.ref != 'refs/heads/main'
with:
check_name: Example Surefire Test Report
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Test with pytest
run: |
python -m pip install --upgrade pip
pip install pytest
pytest --junit-xml=python/report.xml python/ || exit 0
- uses: ./action-surefire-report
if: github.ref != 'refs/heads/main'
with:
check_name: Example Pytest Report
report_paths: python/report.xml
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- run: |
cd go &&
go install github.com/jstemmer/go-junit-report/v2@latest &&
go test -v 2>&1 ./... | go-junit-report -out report.xml
- uses: ./action-surefire-report
if: github.ref != 'refs/heads/main'
with:
check_name: Example Go Report
report_paths: go/report.xml
file_name_in_stack_trace: true

# build and test the action
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
cache-dependency-path: |
action-surefire-report/package-lock.json
- name: Build and test
run: |
npm ci
npm run eslint
npm run test
npm run package
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff

# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v3
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: |
action-surefire-report/dist/
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ name: ci

on:
push:
branches:
- main
paths-ignore:
- 'action-surefire-report/**'
pull_request:
paths-ignore:
- 'action-surefire-report/**'

jobs:
build:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ Github actions used in the Trino project
Some actions are forked with no local changes to defend against changes with a hash collision and repo deletion:
* [github-app-token](/github-app-token) is forked from [https://github.com/tibdex/github-app-token](https://github.com/tibdex/github-app-token) at [v1.6.0 (f66c1c3)](https://github.com/tibdex/github-app-token/commit/f66c1c31c49c0a4d593a5820a9f1e231af3321ad)
* [slash-command-dispatch](/slash-command-dispatch) is forked from [peter-evans/slash-command-dispatch](https://github.com/peter-evans/slash-command-dispatch) at [v3.0.0 (71e68e5)](https://github.com/peter-evans/slash-command-dispatch/commit/71e68e5b4a13cff7a8c0c290f4fb9e615d873944)

Following actions are forked with changes:
* [action-surefire-report](/action-surefire-report) is forked from [ScaCap/action-surefire-report](https://github.com/ScaCap/action-surefire-report) at [v1.6.2 (7263a78)](https://github.com/ScaCap/action-surefire-report/commits/7263a78ba060b395c8a0a0e58fc897efb1bddb7c) to:
* use a more efficient XML parser library, which was reverted in later versions, because it's not portable
1 change: 1 addition & 0 deletions action-surefire-report/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/*
19 changes: 19 additions & 0 deletions action-surefire-report/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2020
},
"rules": {
"indent": 2
}
}
76 changes: 76 additions & 0 deletions action-surefire-report/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
node_modules/

# Editors
.vscode

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Other Dependency directories
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

.factorypath
.classpath
.project
.settings/
target/
.idea
*.iml
junit.xml
report.xml
__pycache__
4 changes: 4 additions & 0 deletions action-surefire-report/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package.json
package-lock.json
.eslintrc.json
.babelrc
12 changes: 12 additions & 0 deletions action-surefire-report/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 100,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote":false,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
5 changes: 5 additions & 0 deletions action-surefire-report/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:16-bullseye-slim

COPY dist /dist

ENTRYPOINT ["node", "/dist/index.js"]
Loading

0 comments on commit e5cd438

Please sign in to comment.