2020-05-21 16:41:13 +00:00
|
|
|
|
name: Ember test audit comparison
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
paths:
|
|
|
|
|
- '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@v2
|
|
|
|
|
with:
|
|
|
|
|
ref: ${{ github.event.pull_request.base.sha }}
|
|
|
|
|
- uses: nanasess/setup-chromedriver@master
|
|
|
|
|
- name: Use Node.js
|
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
|
with:
|
|
|
|
|
node-version: '10.x'
|
|
|
|
|
- run: yarn --frozen-lockfile
|
|
|
|
|
- run: mkdir -p /tmp/test-reports
|
|
|
|
|
- run: npx ember-test-audit 3 --json --output ../base-audit.json
|
|
|
|
|
- name: Upload result
|
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
|
with:
|
|
|
|
|
name: base-audit
|
|
|
|
|
path: base-audit.json
|
|
|
|
|
time-pr:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
- uses: nanasess/setup-chromedriver@master
|
|
|
|
|
- name: Use Node.js
|
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
|
with:
|
|
|
|
|
node-version: '10.x'
|
|
|
|
|
- run: yarn --frozen-lockfile
|
|
|
|
|
- run: mkdir -p /tmp/test-reports
|
|
|
|
|
- run: npx ember-test-audit 3 --json --output ../pr-audit.json
|
|
|
|
|
- name: Upload result
|
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
|
with:
|
|
|
|
|
name: pr-audit
|
|
|
|
|
path: pr-audit.json
|
|
|
|
|
compare:
|
|
|
|
|
needs: [time-base, time-pr]
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
|
with:
|
|
|
|
|
name: base-audit
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
|
with:
|
|
|
|
|
name: pr-audit
|
2021-01-21 14:25:16 +00:00
|
|
|
|
- uses: backspace/ember-test-audit-comparison-action@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
|
2021-01-26 15:06:22 +00:00
|
|
|
|
- uses: marocchino/sticky-pull-request-comment@v2.0.0
|
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
|
|
|
|
|
uses: andstor/file-existence-action@v1
|
|
|
|
|
with:
|
|
|
|
|
files: "flakiness-report.md"
|
|
|
|
|
- name: comment PR
|
|
|
|
|
if: steps.check_file.outputs.files_exists == 'true'
|
2021-01-26 15:06:22 +00:00
|
|
|
|
uses: machine-learning-apps/pr-comment@1.0.0
|
2021-01-21 14:25:16 +00:00
|
|
|
|
env:
|
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
with:
|
|
|
|
|
path: flakiness-report.md
|