Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrybyk committed Aug 19, 2023
0 parents commit e00d576
Show file tree
Hide file tree
Showing 26 changed files with 15,131 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]

# We recommend you to keep these unchanged.
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
23 changes: 23 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2021,
},
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unused-vars': ['error'],
},
}
20 changes: 20 additions & 0 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code Quality

on:
pull_request:
push:
branches: ['main']

jobs:
code_quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- run: npm ci --no-fund --no-audit --no-progress
- run: npm run precommit
- run: npm run build
77 changes: 77 additions & 0 deletions .github/workflows/report_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test Action

on: [push]

jobs:
html_report_test:
runs-on: ubuntu-latest
name: publish html report

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write

steps:
# To use this repository's private action,
# you must check out the repository
- uses: actions/checkout@v3

- name: Checkout gh-pages
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages # branch name
path: gh-pages-dir # checkout path

- name: Local HTML Report
uses: ./ # Uses an action in the root directory
with:
report_id: 'my-allure-report'
gh_pages: 'gh-pages-dir'
report_dir: 'test/allure-results'

# Use the output from the `hello` step
- uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: gh-pages-dir # path to checked out gh-pages branch

# allure_report_test:
# runs-on: ubuntu-latest
# name: publish allure report

# permissions:
# contents: write

# steps:
# - uses: actions/checkout@v3

# - name: Checkout gh-pages
# uses: actions/checkout@v3
# if: always()
# continue-on-error: true
# with:
# ref: gh-pages # branch name
# path: gh-pages-dir # checkout path

# - shell: bash
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV

# - name: Allure Report action from marketplace
# uses: simple-elf/allure-report-action@master
# if: always()
# id: allure-report
# with:
# allure_results: test/allure-results
# gh_pages: gh-pages-dir/allure/${{ env.BRANCH_NAME }}
# allure_report: gh-pages-dir/allure/${{ env.BRANCH_NAME }}/allure-report
# allure_history: gh-pages-dir/allure/${{ env.BRANCH_NAME }}/allure-history
# keep_reports: '999'
# - run: ls -al allure-history
# - run: ls -al allure-report
# - run: ls -al gh-pages-dir/allure

# # Use the output from the `hello` step
# - uses: stefanzweifel/git-auto-commit-action@v4
# with:
# repository: gh-pages-dir # path to checked out gh-pages branch
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.DS_Store
src/report_*.ts
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 140
}
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM timbru31/java-node:17-alpine-jre-18

ARG RELEASE=2.23.1
ARG ALLURE_REPO=https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline

RUN echo $RELEASE &&
apk add --no-cache wget unzip &&
rm -rf /var/cache/apk/*

RUN wget --no-verbose -O /tmp/allure-$RELEASE.tgz $ALLURE_REPO/$RELEASE/allure-commandline-$RELEASE.tgz &&
tar -xf /tmp/allure-$RELEASE.tgz &&
rm -rf /tmp/* &&
chmod -R +x /allure-$RELEASE/bin

ENV ROOT=/app \
PATH=$PATH:/allure-$RELEASE/bin

RUN mkdir -p $ROOT

WORKDIR $ROOT
COPY ./entrypoint.sh /entrypoint.sh
COPY dist /app/js-action

ENTRYPOINT ["entrypoint.sh"]
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# allure-report-branch-action

Allure Report with history per branch

## Inputs

TODO

## Example usage

TODO

## GitHub Pages structure

`allure-report-branch-action/${branchName}/${report_id}/${runId}` ex `allure-report-branch-action/main/allure-report/5815004460/`
22 changes: 22 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Allure Report with history bep branch'
description: 'Generate Allure Report with history per branch'
author: 'mgrybyk'
branding:
icon: 'layout'
color: 'green'
inputs:
report_dir:
description: 'Input allure results dir, default "allure-results"'
required: true
default: 'allure-results'
report_id:
description: 'Output allure report dir, default "allure-report"'
required: true
default: 'allure-report'
gh_pages:
description: 'Folder with gh-pages branch'
required: true
default: 'gh-pages'
runs:
using: 'docker'
image: 'Dockerfile'
Loading

0 comments on commit e00d576

Please sign in to comment.