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 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# spec tests pipeline plan | ||
|
||
# Stage 1: | ||
# - Run tests on the children specs | ||
# - report it back in this spec PR as a comment | ||
|
||
# Stage 2: | ||
# - scheduled run on the children specs repo, like in a daily basis | ||
# - if failure aggregate the results in an issue | ||
# - each run is logged in that issue with the failed spec repo version | ||
|
||
# Stage 3: | ||
# - improve notification: should it go to Discord/Slack/Email/etc? | ||
|
||
name: Test Implementation Repos | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- leordev/test-implementations | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
include: | ||
- repo: tbdex-js | ||
ci_file: integrity-check.yml | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Generate an access token to write to downstream repo | ||
uses: actions/create-github-app-token@2986852ad836768dfea7781f31828eb3e17990fa # v1.6.2 | ||
id: app-token | ||
with: | ||
app-id: ${{ secrets.CICD_ROBOT_GITHUB_APP_ID }} | ||
private-key: ${{ secrets.CICD_ROBOT_GITHUB_APP_PRIVATE_KEY }} | ||
owner: TBD54566975 | ||
repositories: ${{ matrix.repo }} | ||
|
||
- name: Checkout spec repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ steps.app-token.outputs.token }} | ||
repository: TBD54566975/${{ matrix.repo }} | ||
ref: main | ||
submodules: true | ||
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config | ||
persist-credentials: false | ||
|
||
- name: Update spec submodule in ${{ matrix.repo }} | ||
env: | ||
# get the current sha from the action event | ||
SPEC_SHA: ${{ github.event.head_commit.id }} | ||
run: | | ||
cd tbdex | ||
git fetch origin ${{ env.SPEC_SHA }} | ||
cd .. | ||
SHORT_SHA=$(echo ${{ env.SPEC_SHA }} | cut -c 1-8) | ||
git checkout -b spec/tbdex-$SHORT_SHA | ||
git add . | ||
git commit -m "Update spec to $SHORT_SHA" | ||
git push origin spec/tbdex-$SHORT_SHA | ||
# - name: Trigger tbdex-js CI pipeline | ||
# env: | ||
# SHORT_SHA: ${{ steps.spec-sha.outputs.SHORT_SHA }} | ||
# run: | | ||
# # Trigger CI pipeline for tbdex-js (example with GitHub Actions) | ||
# curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ | ||
# -H "Accept: application/vnd.github.v3+json" \ | ||
# https://api.github.com/repos/your-org/${{ matrix.repo }}/actions/workflows/${{ matrix.ci_file }}/dispatches \ | ||
# -d '{"ref":"spec/tbdex-${{ env.SHORT_SHA }}"}' | ||
|
||
# - name: Aggregate test results | ||
# run: | | ||
# # Logic to aggregate test results from child repositories | ||
# # Send notifications to stakeholders |