2020-05-21 16:41:13 +00:00
|
|
|
|
name: Ember test audit comparison
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
paths:
|
2023-02-09 20:28:30 +00:00
|
|
|
|
- '.github/workflows/ember*'
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- '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:
|
2023-05-17 14:38:10 +00:00
|
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
2023-05-19 13:07:02 +00:00
|
|
|
|
- uses: nanasess/setup-chromedriver@95301782a076fbe8c9ecf54395a4689f7b195285 # v2.0.0
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- name: Use Node.js
|
2023-05-17 14:38:10 +00:00
|
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
2022-05-05 20:05:13 +00:00
|
|
|
|
node-version: '14'
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- run: yarn --frozen-lockfile
|
|
|
|
|
- run: mkdir -p /tmp/test-reports
|
2023-02-09 20:28:30 +00:00
|
|
|
|
- run: npx ember-test-audit 1 --json --output ../base-audit.json
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- name: Upload result
|
2023-05-17 14:38:10 +00:00
|
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
name: base-audit
|
|
|
|
|
path: base-audit.json
|
|
|
|
|
time-pr:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2023-05-17 14:38:10 +00:00
|
|
|
|
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2023-05-19 13:07:02 +00:00
|
|
|
|
- uses: nanasess/setup-chromedriver@95301782a076fbe8c9ecf54395a4689f7b195285 # v2.0.0
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- name: Use Node.js
|
2023-05-17 14:38:10 +00:00
|
|
|
|
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
2022-05-05 20:05:13 +00:00
|
|
|
|
node-version: '14'
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- run: yarn --frozen-lockfile
|
|
|
|
|
- run: mkdir -p /tmp/test-reports
|
2023-02-09 20:28:30 +00:00
|
|
|
|
- run: npx ember-test-audit 1 --json --output ../pr-audit.json
|
2020-05-21 16:41:13 +00:00
|
|
|
|
- name: Upload result
|
2023-05-17 14:38:10 +00:00
|
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
name: pr-audit
|
|
|
|
|
path: pr-audit.json
|
|
|
|
|
compare:
|
|
|
|
|
needs: [time-base, time-pr]
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2023-05-17 14:38:10 +00:00
|
|
|
|
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
name: base-audit
|
2023-05-17 14:38:10 +00:00
|
|
|
|
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
name: pr-audit
|
2023-05-19 13:07:02 +00:00
|
|
|
|
- uses: backspace/ember-test-audit-comparison-action@21e9492d0033bc7e84b6189ae94537a6ed045cfa # v2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
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 }}
|
2021-01-21 14:25:16 +00:00
|
|
|
|
timing-output-path: audit-diff.md
|
|
|
|
|
flakiness-output-path: flakiness-report.md
|
2023-05-17 14:38:10 +00:00
|
|
|
|
- uses: marocchino/sticky-pull-request-comment@f61b6cf21ef2fcc468f4345cdfcc9bda741d2343 # v2.6.2
|
2020-05-21 16:41:13 +00:00
|
|
|
|
with:
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
path: audit-diff.md
|
2021-01-21 14:25:16 +00:00
|
|
|
|
- name: Check for existence of flakiness report
|
|
|
|
|
id: check_file
|
2023-05-19 13:07:02 +00:00
|
|
|
|
uses: andstor/file-existence-action@f02338908d150e00a4b8bebc2dad18bd9e5229b0 # v1.1.0
|
2021-01-21 14:25:16 +00:00
|
|
|
|
with:
|
|
|
|
|
files: "flakiness-report.md"
|
|
|
|
|
- name: comment PR
|
|
|
|
|
if: steps.check_file.outputs.files_exists == 'true'
|
2023-05-19 13:07:02 +00:00
|
|
|
|
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 # v2.8.1
|
2021-01-21 14:25:16 +00:00
|
|
|
|
env:
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
with:
|
2023-05-19 13:07:02 +00:00
|
|
|
|
message_path: flakiness-report.md
|