diff --git a/.github/workflows/ai.yaml b/.github/workflows/ai.yaml new file mode 100644 index 0000000..899b2fb --- /dev/null +++ b/.github/workflows/ai.yaml @@ -0,0 +1,34 @@ +name: ai + +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: npx tsc + - name: Test ai with title + run: node dist/index.js ai ctrf-reports/ctrf-report.json --title "AI Summary With Title" + - name: Test ai without title + run: node dist/index.js ai ctrf-reports/ctrf-report.json + - 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 diff --git a/.github/workflows/custom.yaml b/.github/workflows/custom.yaml new file mode 100644 index 0000000..3d76cb0 --- /dev/null +++ b/.github/workflows/custom.yaml @@ -0,0 +1,36 @@ +name: custom + +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: npx tsc + - name: Test custom summary hbs file + run: node dist/index.js custom ctrf-reports/ctrf-report.json templates/custom-summary.hbs + if: github.event_name != 'schedule' + - name: Test custom summary string + run: node dist/index.js custom ctrf-reports/ctrf-report.json "I'm a custom summary string!" + if: github.event_name != 'schedule' + - 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 diff --git a/.github/workflows/detailed.yaml b/.github/workflows/detailed.yaml new file mode 100644 index 0000000..d0e970e --- /dev/null +++ b/.github/workflows/detailed.yaml @@ -0,0 +1,34 @@ +name: detailed + +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: npx tsc + - name: Test detailed with title + run: node dist/index.js tests ctrf-reports/ctrf-report.json --title "Detailed With Title" + - name: Test default no title + run: node dist/index.js ctrf-reports/ctrf-report.json --annotate false + - 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 diff --git a/.github/workflows/failed.yaml b/.github/workflows/failed.yaml new file mode 100644 index 0000000..2560e71 --- /dev/null +++ b/.github/workflows/failed.yaml @@ -0,0 +1,34 @@ +name: failed + +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: npx tsc + - name: Test failed with title + run: node dist/index.js failed ctrf-reports/ctrf-report.json --title Failed With Title + - name: Test failed no title + run: node dist/index.js failed ctrf-reports/ctrf-report.json + - 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 diff --git a/.github/workflows/flaky.yaml b/.github/workflows/flaky.yaml new file mode 100644 index 0000000..ec4a3aa --- /dev/null +++ b/.github/workflows/flaky.yaml @@ -0,0 +1,34 @@ +name: flaky + +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: npx tsc + - name: Test flaky with title + run: node dist/index.js flaky ctrf-reports/ctrf-report.json --title "Flaky With Title" + - name: Test flaky with out title + run: node dist/index.js flaky ctrf-reports/ctrf-report.json + - 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 diff --git a/.github/workflows/historical.yaml b/.github/workflows/historical.yaml new file mode 100644 index 0000000..e61fefd --- /dev/null +++ b/.github/workflows/historical.yaml @@ -0,0 +1,45 @@ +name: historical + +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: npx tsc + - name: Test historical + run: node dist/index.js historical ctrf-reports/ctrf-report.json --annotate false + if: github.event_name != 'schedule' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test historical row arg set to 2 + run: node dist/index.js historical ctrf-reports/ctrf-report.json --annotate false --rows 2 --title "Historical With Max Rows 2" + if: github.event_name != 'schedule' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test historical with custom artifact name + run: node dist/index.js historical ctrf-reports/ctrf-report-no-fails.json --annotate false --rows 2 --title "Historical With Custom Artifact Name" --artifact-name custom-artifact-name + if: github.event_name != 'schedule' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - 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 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6d082ec..7b65ac1 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -27,76 +27,9 @@ jobs: - name: Test summary run: node dist/index.js summary ctrf-reports/ctrf-report.json --title Summary if: github.event_name != 'schedule' - - name: Test flaky - run: node dist/index.js flaky ctrf-reports/ctrf-report.json --title Flaky - if: github.event_name != 'schedule' - - name: Test failed - run: node dist/index.js failed ctrf-reports/ctrf-report.json --title Failed - if: github.event_name != 'schedule' - - name: Test failed - run: node dist/index.js ai ctrf-reports/ctrf-report.json --title "AI Summary" - if: github.event_name != 'schedule' - - name: Test failed no title - run: node dist/index.js failed ctrf-reports/ctrf-report.json - if: github.event_name != 'schedule' - - name: Test skipped - run: node dist/index.js skipped ctrf-reports/ctrf-report.json --title "Skipped" - if: github.event_name != 'schedule' - - name: Test detailed - run: node dist/index.js tests ctrf-reports/ctrf-report.json --title Detailed - if: github.event_name != 'schedule' - - name: Test default title - run: node dist/index.js ctrf-reports/ctrf-report.json --annotate false - if: github.event_name != 'schedule' - name: Test no fails or flaky run: node dist/index.js ctrf-reports/ctrf-report-no-fails.json if: github.event_name != 'schedule' - - name: Test custom summary hbs file - run: node dist/index.js custom ctrf-reports/ctrf-report.json templates/custom-summary.hbs - if: github.event_name != 'schedule' - - name: Test custom summary string - run: node dist/index.js custom ctrf-reports/ctrf-report.json "I'm a custom summary string!" - if: github.event_name != 'schedule' - - name: Test PR comment - run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --title "With PR Comment" --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test historical - run: node dist/index.js historical ctrf-reports/ctrf-report.json --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test historical row arg set to 2 - run: node dist/index.js historical ctrf-reports/ctrf-report.json --annotate false --rows 2 --title "Historical With Max Rows 2" - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test historical with custom artifact name - run: node dist/index.js historical ctrf-reports/ctrf-report-no-fails.json --annotate false --rows 2 --title "Historical With Custom Artifact Name" --artifact-name custom-artifact-name - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test PR comment no fails - run: node dist/index.js ctrf-reports/ctrf-report-no-fails.json --pr-comment --title "With PR Comment No Fails" --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test PR comment no fails with on fail only true - run: node dist/index.js ctrf-reports/ctrf-report-no-fails.json --pr-comment --on-fail-only --title "With PR Comment On Fail Only No Fail" --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test PR comment with fails and on fail set to true - run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --on-fail-only --title "With PR Comment On Fail Only With Fails" --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Test PR with custom message hbs file - run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --pr-comment-message "templates/custom-summary.hbs" --title "PR With HandleBars file" --annotate false - if: github.event_name != 'schedule' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Test schedule context run: node dist/index.js ctrf-reports/ctrf-report.json if: github.event_name == 'schedule' diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..1a477ba --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,50 @@ +name: pull-request + +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: npx tsc + - name: Test PR comment + run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --title "With PR Comment" --annotate false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test PR comment no fails + run: node dist/index.js ctrf-reports/ctrf-report-no-fails.json --pr-comment --title "With PR Comment No Fails" --annotate false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test PR comment no fails with on fail only true + run: node dist/index.js ctrf-reports/ctrf-report-no-fails.json --pr-comment --on-fail-only --title "With PR Comment On Fail Only No Fail" --annotate false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test PR comment with fails and on fail set to true + run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --on-fail-only --title "With PR Comment On Fail Only With Fails" --annotate false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Test PR with custom message hbs file + run: node dist/index.js ctrf-reports/ctrf-report.json --pr-comment --pr-comment-message "templates/custom-summary.hbs" --title "PR With HandleBars file" --annotate false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - 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 diff --git a/.github/workflows/skipped.yaml b/.github/workflows/skipped.yaml new file mode 100644 index 0000000..337a973 --- /dev/null +++ b/.github/workflows/skipped.yaml @@ -0,0 +1,34 @@ +name: skipped + +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: npx tsc + - name: Test skipped with title + run: node dist/index.js skipped ctrf-reports/ctrf-report.json --title "Skipped With Title" + - name: Test failed no title + run: node dist/index.js skipped ctrf-reports/ctrf-report.json + - 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