mirror of
https://github.com/kemko/nomad.git
synced 2026-01-05 01:45:44 +03:00
88 lines
3.3 KiB
YAML
88 lines
3.3 KiB
YAML
name: Ember test audit comparison
|
||
on:
|
||
pull_request:
|
||
paths:
|
||
- '.github/workflows/ember*'
|
||
- 'ui/**'
|
||
|
||
defaults:
|
||
run:
|
||
working-directory: ui
|
||
|
||
# There’s currently no way to share steps between jobs so there’s a lot of duplication
|
||
# for running the audit for the base and PR.
|
||
jobs:
|
||
time-base:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||
with:
|
||
ref: ${{ github.event.pull_request.base.sha }}
|
||
- uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2
|
||
- name: Use Node.js
|
||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||
with:
|
||
node-version: '18'
|
||
- run: yarn --frozen-lockfile
|
||
- run: mkdir -p /tmp/test-reports
|
||
- run: npx ember-test-audit 1 --json --output ../base-audit.json
|
||
- name: Upload result
|
||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||
with:
|
||
name: base-audit
|
||
path: base-audit.json
|
||
time-pr:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||
- uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2
|
||
- name: Use Node.js
|
||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||
with:
|
||
node-version: '18'
|
||
- run: yarn --frozen-lockfile
|
||
- run: mkdir -p /tmp/test-reports
|
||
- run: npx ember-test-audit 1 --json --output ../pr-audit.json
|
||
- name: Upload result
|
||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||
with:
|
||
name: pr-audit
|
||
path: pr-audit.json
|
||
compare:
|
||
needs: [time-base, time-pr]
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||
with:
|
||
name: base-audit
|
||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||
with:
|
||
name: pr-audit
|
||
- uses: backspace/ember-test-audit-comparison-action@21e9492d0033bc7e84b6189ae94537a6ed045cfa # v2
|
||
with:
|
||
base-report-path: base-audit.json
|
||
comparison-report-path: pr-audit.json
|
||
base-identifier: ${{ github.event.pull_request.base.ref }}
|
||
comparison-identifier: ${{ github.event.pull_request.head.sha }}
|
||
timing-output-path: audit-diff.md
|
||
flakiness-output-path: flakiness-report.md
|
||
- uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
|
||
with:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
path: audit-diff.md
|
||
- name: Check for existence of flakiness report
|
||
id: check_file
|
||
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3.0.0
|
||
with:
|
||
files: "flakiness-report.md"
|
||
- name: comment PR
|
||
if: steps.check_file.outputs.files_exists == 'true'
|
||
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2.8.2
|
||
env:
|
||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||
with:
|
||
message-path: flakiness-report.md
|
||
permissions:
|
||
contents: read
|
||
pull-requests: write
|