Skip to content

Commit 512308b

Browse files
committed
task: add report tests automation (#1632)
2 parents f074cef + 5df39ce commit 512308b

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Garak Report Artifact Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'garak-report/**'
7+
workflow_dispatch:
8+
9+
permissions:
10+
actions: none
11+
checks: none
12+
contents: none
13+
deployments: none
14+
id-token: none
15+
issues: none
16+
discussions: none
17+
packages: none
18+
pages: none
19+
pull-requests: none
20+
repository-projects: none
21+
security-events: none
22+
statuses: none
23+
24+
jobs:
25+
index_check:
26+
name: Report HTML Index Up-To-Date
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
node-version: ["25"]
31+
steps:
32+
- uses: actions/checkout@v3
33+
- name: Set up Node ${{ matrix.node-version }}
34+
uses: actions/setup-node@v6.2.0
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
- name: Install report dependencies
38+
run: |
39+
cd garak-report
40+
corepack enable
41+
yarn install
42+
- name: Build React Report
43+
run: |
44+
cd garak-report
45+
yarn build
46+
set +e
47+
git diff --exit-code > /dev/null
48+
if [ $? -ne 0 ]; then
49+
set -e
50+
echo "Report build shows uncommitted changes, please commit an updated garak/analyze/ui/index.html"
51+
exit 1
52+
else
53+
echo "Report build is up-to-date"
54+
fi
55+
56+
report_tests:
57+
name: Report Testing
58+
runs-on: ubuntu-latest
59+
strategy:
60+
matrix:
61+
node-version: ["25"]
62+
steps:
63+
- uses: actions/checkout@v3
64+
- name: Set up Node ${{ matrix.node-version }}
65+
uses: actions/setup-node@v6.2.0
66+
with:
67+
node-version: ${{ matrix.node-version }}
68+
- name: Install report dependencies
69+
run: |
70+
cd garak-report
71+
corepack enable
72+
yarn install
73+
74+
- name: Yarn Testing
75+
run: |
76+
cd garak-report
77+
yarn test
78+
79+

0 commit comments

Comments
 (0)