Skip to content

Commit 9414324

Browse files
chore(ci): add ketryx reporting workflow for compliance and tracking
1 parent 77db132 commit 9414324

File tree

6 files changed

+614
-640
lines changed

6 files changed

+614
-640
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Ketryx report'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-name:
7+
description: 'The build name to report'
8+
required: true
9+
type: string
10+
secrets:
11+
KETRYX_PROJECT:
12+
description: 'Ketryx project ID'
13+
required: true
14+
KETRYX_API_KEY:
15+
description: 'Ketryx API key'
16+
required: true
17+
18+
jobs:
19+
report-to-ketryx:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Download SDK test results
23+
uses: actions/download-artifact@v4
24+
continue-on-error: true
25+
with:
26+
name: test-results-sdk
27+
path: test-results/sdk/
28+
29+
- name: Download CLI test results
30+
uses: actions/download-artifact@v4
31+
continue-on-error: true
32+
with:
33+
name: test-results-cli
34+
path: test-results/cli/
35+
36+
- name: Report to Ketryx
37+
uses: Ketryx/ketryx-github-action@v1.4.0
38+
with:
39+
project: ${{ secrets.KETRYX_PROJECT }}
40+
api-key: ${{ secrets.KETRYX_API_KEY }}
41+
build-name: ${{ inputs.build-name }}
42+
test-junit-path: test-results/**/*.xml

.github/workflows/ci-cd.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ jobs:
5353
- name: Run tests with coverage
5454
run: npx nx run-many -t test --coverage
5555

56+
- name: Upload SDK test results
57+
if: matrix.node-version == '20.x'
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: test-results-sdk
61+
path: packages/sdk/test-results/*.xml
62+
63+
- name: Upload CLI test results
64+
if: matrix.node-version == '20.x'
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: test-results-cli
68+
path: packages/cli/test-results/*.xml
69+
5670
- name: Upload coverage to Codecov
5771
if: matrix.node-version == '20.x'
5872
uses: codecov/codecov-action@v3
@@ -108,11 +122,21 @@ jobs:
108122
publish_dir: ./docs
109123
cname: aignostics-platform-sdk.github.io
110124

125+
run-ketryx-report:
126+
needs: test
127+
if: github.ref == 'refs/heads/main'
128+
uses: ./.github/workflows/_report-to-ketryx.yml
129+
with:
130+
build-name: "pre-release"
131+
secrets:
132+
KETRYX_PROJECT: KXPRJ7F47PAK8VB9B4BB0G4AYCXCBSY # not a secret
133+
KETRYX_API_KEY: ${{ secrets.KETRYX_API_KEY }}
134+
111135
release:
112136
permissions:
113137
contents: write
114138
runs-on: ubuntu-latest
115-
needs: [test, build-docs]
139+
needs: [test, build-docs, run-ketryx-report]
116140
if: github.ref == 'refs/heads/main'
117141
environment:
118142
name: production

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ build/
1616
coverage/
1717
*.lcov
1818

19+
# Test results
20+
test-results/
21+
1922
# IDE
2023
.vscode/
2124
.idea/

0 commit comments

Comments
 (0)