Update Test Vectors to be Correct Naming Schema #401
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tbdex SDK Kotlin CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/versions.properties') }} | |
- name: Run Gradle Tasks | |
run: ./gradlew build koverXmlReport | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
verbose: true | |
flags: ${{ runner.os }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: test-results | |
path: | | |
**/build/test-results/test/*TbdexTestVectors*.xml | |
- name: Publish Tests Results | |
env: | |
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }} | |
run: | | |
declare -a projects=("protocol" "httpclient") | |
for project in "${projects[@]}"; do | |
# Find Tests Reports in each project and store them in an array | |
files=($(find "${project}/build/test-results/test" -name '*.xml')) | |
# Check if files array is empty | |
if [ ${#files[@]} -eq 0 ]; then | |
echo "No Tests files found in ${project} directory!" | |
exit 1 | |
else | |
echo "Found ${#files[@]} XML files in ${project} directory, proceeding with upload..." | |
fi | |
# Iterate over the files and upload each one | |
for file in "${files[@]}"; do | |
echo "Uploading ${file} to BuildKite..." | |
curl \ | |
-X POST \ | |
--fail-with-body \ | |
-H "Authorization: Token token=\"$BUILDKITE_ANALYTICS_TOKEN\"" \ | |
-F "data=@$file" \ | |
-F "format=junit" \ | |
-F "run_env[CI]=github_actions" \ | |
-F "run_env[key]=$GITHUB_ACTION-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \ | |
-F "run_env[number]=$GITHUB_RUN_NUMBER" \ | |
-F "run_env[branch]=$GITHUB_REF" \ | |
-F "run_env[commit_sha]=$GITHUB_SHA" \ | |
-F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ | |
https://analytics-api.buildkite.com/v1/uploads | |
done | |
done | |
- name: Generate an access token to trigger downstream repo | |
uses: actions/create-github-app-token@2986852ad836768dfea7781f31828eb3e17990fa # v1.6.2 | |
id: generate_token | |
if: github.ref == 'refs/heads/main' | |
with: | |
app-id: ${{ secrets.CICD_ROBOT_GITHUB_APP_ID }} | |
private-key: ${{ secrets.CICD_ROBOT_GITHUB_APP_PRIVATE_KEY }} | |
owner: TBD54566975 | |
repositories: sdk-report-runner | |
- name: Trigger sdk-report-runner report build | |
if: github.ref == 'refs/heads/main' | |
run: | | |
curl -L \ | |
-H "Authorization: Bearer ${APP_TOKEN}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-H "Content-Type: application/json" \ | |
--fail \ | |
--data '{"ref": "main"}' \ | |
https://api.github.com/repos/TBD54566975/sdk-report-runner/actions/workflows/build-report.yaml/dispatches | |
env: | |
APP_TOKEN: ${{ steps.generate_token.outputs.token }} |