-
Notifications
You must be signed in to change notification settings - Fork 2k
151 lines (149 loc) · 6.44 KB
/
ember-test-audit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.base.sha }}
- uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2
- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: '18'
- run: yarn --frozen-lockfile
- run: mkdir -p /tmp/test-reports
# # Debug steps
# - run: yarn --version
# - run: yarn list --pattern "ember-test-audit" || true
# - run: yarn list --pattern "@ember/test-helpers" || true
# Try installing explicitly before running
- run: yarn add [email protected] --dev
# - run: |
# set -x
# echo "=== Starting Tests ==="
# export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
# export TESTEM_LOG_FILE='/tmp/testem.log'
# timeout 900 yarn ember-test-audit 1 --json --output ../base-audit.json || {
# echo "=== Process timed out or failed ==="
# echo "=== Last Testem Logs ==="
# cat /tmp/testem.log || true
# echo "=== Chrome Process Check ==="
# ps aux | grep chrome || true
# exit 1
# }
# - run: |
# export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
# yarn ember-test-audit 1 --json --output ../base-audit.json
- run: |
set -x
echo "=== Starting Tests ==="
export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
export TESTEM_LOG_FILE='/tmp/testem.log'
yarn ember-test-audit 1 --json --output ../base-audit.json || {
echo "=== Process failed ==="
echo "=== Last Testem Logs ==="
cat /tmp/testem.log || true
echo "=== Chrome Process Check ==="
pgrep -a chrome || true
exit 1
}
- name: Upload result
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: base-audit
path: base-audit.json
time-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa # v2.2.2
- name: Use Node.js
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: '18'
- run: yarn --frozen-lockfile
- run: mkdir -p /tmp/test-reports
- run: yarn add [email protected] --dev
# - run: npx ember-test-audit 1 --json --output ../pr-audit.json
# - run: |
# export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
# yarn ember-test-audit 1 --json --output ../pr-audit.json
# - run: |
# set -x
# echo "=== Starting Tests ==="
# export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
# export TESTEM_LOG_FILE='/tmp/testem.log'
# timeout 900 yarn ember-test-audit 1 --json --output ../pr-audit.json || {
# echo "=== Process timed out or failed ==="
# echo "=== Last Testem Logs ==="
# cat /tmp/testem.log || true
# echo "=== Chrome Process Check ==="
# ps aux | grep chrome || true
# exit 1
# }
- run: |
set -x
echo "=== Starting Tests ==="
export CHROME_FLAGS="--headless --disable-gpu --no-sandbox --disable-dev-shm-usage --memory-pressure-off --js-flags=\"--max_old_space_size=4096\""
export TESTEM_LOG_FILE='/tmp/testem.log'
yarn ember-test-audit 1 --json --output ../pr-audit.json || {
echo "=== Process failed ==="
echo "=== Last Testem Logs ==="
cat /tmp/testem.log || true
echo "=== Chrome Process Check ==="
pgrep -a chrome || true
exit 1
}
- name: Upload result
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
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