This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (129 loc) · 6.17 KB
/
build-conformance-table.yaml
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
name: Build SDKs Version Conformace Matrix Dashboard
on:
workflow_dispatch:
inputs:
specTag:
description: "The tag of the spec, eg: v2.0"
type: string
required: true
specRepo:
description: "TBD Specs"
type: choice
required: true
options:
- web5-spec
- tbdex
sdkReleaseRepo:
description: "The release repo, eg: TBD54566975/web5-rs, TBD54566975/tbdex-js (sdk mode only)"
type: string
required: false
sdkReleasePackageName:
description: "The name of the package that is being released (useful for monorepos, eg: web5-rs releases web5-core-kt)"
type: string
required: false
sdkReleaseTag:
description: "The release tag, eg: v1.23 (sdk mode only)"
type: string
required: false
sdkReleaseWorkflowRunId:
description: "The run ID of the source workflow that uploaded the tests vectors (sdk mode only)"
type: string
required: false
sdkReleaseJunitFiles:
description: "The name of the artifact that contains the JUnit XML files (sdk mode only)" # kotlin-test-results,
type: string
required: false
sdkSuiteJunitRegexParams:
description: "The SDK regex params, should be a string in the following order split by newlines: suiteNameRegex, featureRegex, vectorRegex, extractFeatureOnTestCaseName, prettifyFeature"
type: string
required: false
permissions:
contents: write
jobs:
update-conformance-table:
concurrency: conformance-table-build # always run one instance of this workflow, to avoid conflicts in the conformance json generation
runs-on: ubuntu-latest
steps:
- name: Prepare Release Mode Inputs
id: release-mode
run: |
echo "Spec Tag: ${{ inputs.specTag }}"
echo "Spec Repo: TBD ${{ inputs.specRepo }}"
echo "SPEC_FULL_REPO=TBD54566975/${{ inputs.specRepo }}" >> $GITHUB_OUTPUT
if [[ "${{ inputs.sdkReleaseRepo }}" != "" ]]; then
echo "sdkReleaseRepo is present - Release Mode = SDK"
echo "Release Repo Tag: ${{ inputs.sdkReleaseTag }}"
echo "Release JUnit Files Artifact Name: ${{ inputs.sdkReleaseJunitFiles }}"
echo "Release Workflow Run ID: ${{ inputs.sdkReleaseWorkflowRunId }}"
# throw an error if any of the sdk mode inputs are not set
if [[ "${{ inputs.sdkReleaseRepo }}" == "" || "${{ inputs.sdkReleaseTag }}" == "" || "${{ inputs.sdkReleaseJunitFiles }}" == "" || "${{ inputs.sdkReleaseWorkflowRunId }}" == "" || "${{ inputs.sdkSuiteJunitRegexParams }}" == "" ]]; then
echo "Error: All SDK mode inputs are required"
exit 1
fi
# Read the input into an array, preserving empty lines
regex_input="${{ inputs.sdkSuiteJunitRegexParams }}"
readarray -t sdkSuiteJunitRegexParamsArray <<< "$regex_input"
echo "All Suite Regex Params array elements:"
for i in "${!sdkSuiteJunitRegexParamsArray[@]}"; do
echo "Element $i: ${sdkSuiteJunitRegexParamsArray[$i]}"
done
# Function to safely get array element or default value
get_suite_regex_param() {
local index=$1
local default=$2
if [[ -n "${sdkSuiteJunitRegexParamsArray[$index]}" ]]; then
echo "${sdkSuiteJunitRegexParamsArray[$index]}"
else
echo "$default"
fi
}
# Set and output parameters
SUITE_NAME_REGEX=$(get_suite_regex_param 0 "")
FEATURE_REGEX=$(get_suite_regex_param 1 "")
VECTOR_REGEX=$(get_suite_regex_param 2 "")
EXTRACT_FEATURE=$(get_suite_regex_param 3 "false")
PRETTIFY_FEATURE=$(get_suite_regex_param 4 "false")
echo "SUITE_NAME_REGEX: $SUITE_NAME_REGEX"
echo "SUITE_NAME_REGEX=$SUITE_NAME_REGEX" >> $GITHUB_OUTPUT
echo "FEATURE_REGEX: $FEATURE_REGEX"
echo "FEATURE_REGEX=$FEATURE_REGEX" >> $GITHUB_OUTPUT
echo "VECTOR_REGEX: $VECTOR_REGEX"
echo "VECTOR_REGEX=$VECTOR_REGEX" >> $GITHUB_OUTPUT
echo "EXTRACT_FEATURE: $EXTRACT_FEATURE"
echo "EXTRACT_FEATURE=$EXTRACT_FEATURE" >> $GITHUB_OUTPUT
echo "PRETTIFY_FEATURE: $PRETTIFY_FEATURE"
echo "PRETTIFY_FEATURE=$PRETTIFY_FEATURE" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@v4
- name: Checkout spec repo
uses: actions/checkout@v4
with:
repository: ${{ steps.release-mode.outputs.SPEC_FULL_REPO }}
path: ${{ inputs.specRepo }}
ref: ${{ inputs.specTag }}
- name: Download artifacts
uses: actions/download-artifact@v4
if: ${{ inputs.sdkReleaseRepo != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ inputs.sdkReleaseRepo }}
run-id: ${{ github.event.inputs.sdkReleaseWorkflowRunId }}
name: ${{ inputs.sdkReleaseJunitFiles }}
path: junit-results
- name: Builds conformance table
uses: TBD54566975/sdk-report-runner/.github/actions/specs-report@leordev/conformance # TODO: change before merge
with:
junit-report-paths: junit-results/**/*.xml
spec-path: ${{ inputs.specRepo }}
spec-name: ${{ inputs.specRepo }}
spec-tag: ${{ inputs.specTag }}
release-mode: ${{ inputs.sdkReleaseRepo != '' && 'sdk' || 'spec' }}
release-repo: ${{ inputs.sdkReleaseRepo || steps.release-mode.outputs.SPEC_FULL_REPO }}
release-package-name: ${{ inputs.sdkReleasePackageName }}
release-tag: ${{ inputs.sdkReleaseTag }}
suite-name-regex: ${{ steps.release-mode.outputs.SUITE_NAME_REGEX }}
feature-regex: ${{ steps.release-mode.outputs.FEATURE_REGEX }}
vector-regex: ${{ steps.release-mode.outputs.VECTOR_REGEX }}
extract-feature-on-test-case-name: ${{ steps.release-mode.outputs.EXTRACT_FEATURE }}
prettify-feature: ${{ steps.release-mode.outputs.PRETTIFY_FEATURE }}
git-token: ${{ secrets.GITHUB_TOKEN }}