Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
conformance wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leordev committed Sep 19, 2024
1 parent 4d482ad commit 3ea69d6
Show file tree
Hide file tree
Showing 9 changed files with 1,703 additions and 44 deletions.
1,128 changes: 1,127 additions & 1 deletion .github/actions/specs-report/README.md

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions .github/actions/specs-report/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ inputs:
description:
'Glob Path with the JUnit test vectors report, can be a single path or a
list of paths in an array'
required: true
required: true # required if release-mode is "none"
spec-path:
description: 'The relative path to the tbd spec submodule folder'
required: true
required: true # required if release-mode is "none"
suite-name-regex:
description: 'The regex to filter the suite name'
required: false
Expand All @@ -33,6 +33,13 @@ inputs:
fail-on-failed-test-cases:
description: 'Whether to fail the job if failed test cases are found'
required: false
release-mode:
description: 'Set to "spec" or "sdk" to handle release updates'
required: false
default: 'none'
spec-release-tag:
description: 'The tag of the spec release'
required: false # required if release-mode is "spec"

# Define your outputs here.
outputs:
Expand Down
138 changes: 138 additions & 0 deletions .github/actions/specs-report/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .github/actions/specs-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"prettier": "^3.3.3",
"prettier-eslint": "^16.3.0",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"typescript": "^5.5.4"
}
}
42 changes: 39 additions & 3 deletions .github/actions/specs-report/src/action-inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,72 @@ export interface ActionInputs {
failOnMissingVectors: boolean
/** Whether to fail the job if failed test cases are found */
failOnFailedTestCases: boolean
/** The release mode to handle conformance dashboard */
releaseMode: string
/** The release repo, eg: TBD54566975/web5-spec for spec releases, TBD54566975/web5-rs */
releaseRepo: string
/** The tag of the release */
releaseTag: string
/** The name of the spec, eg: web5-spec */
specName: string
/** The tag of the spec, eg: v2.0 */
specTag: string
}

/**
* Reads the inputs for the action.
* @returns {ActionInputs} The inputs for the action.
*/
export const readActionInputs = (): ActionInputs => {
const releaseMode = core.getInput('release-mode') || 'none'
const isDefaultReport = releaseMode === 'none'
const isReleaseMode = releaseMode === 'spec' || releaseMode === 'sdk'

const junitReportPaths = core.getInput('junit-report-paths', {
required: true
required: isDefaultReport
})
const specPath = core.getInput('spec-path', { required: true })
const specPath = core.getInput('spec-path', { required: isDefaultReport })

// Fallback to the default tbdex-js regex filters if not provided
const suiteRegexStrFilters = {
suiteName: core.getInput('suite-name-regex') || 'TbdexTestVector',
feature: core.getInput('feature-regex') || 'TbdexTestVectors(\\w+)',
vector: core.getInput('vector-regex') || 'TbdexTestVectors(\\w+) (\\w+)'
}

const gitToken = core.getInput('git-token')
const commentOnPr = core.getInput('comment-on-pr') === 'true'
const failOnMissingVectors =
core.getInput('fail-on-missing-vectors') === 'true'
const failOnFailedTestCases =
core.getInput('fail-on-failed-test-cases') === 'true'

const releaseRepo = core.getInput('release-repo', {
required: isReleaseMode
})
const releaseTag = core.getInput('release-tag', {
required: releaseMode === 'sdk'
})

const specName = core.getInput('spec-name', {
required: isReleaseMode
})
const specTag = core.getInput('spec-tag', {
required: isReleaseMode
})

return {
junitReportPaths,
specPath,
suiteRegexStrFilters,
gitToken,
commentOnPr,
failOnMissingVectors,
failOnFailedTestCases
failOnFailedTestCases,
releaseMode,
releaseRepo,
releaseTag,
specName,
specTag
}
}
Loading

0 comments on commit 3ea69d6

Please sign in to comment.