-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: introduce test-implementations-e2e
- Loading branch information
1 parent
6c7ffe3
commit b466645
Showing
1 changed file
with
85 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,85 @@ | ||
name: Generate Implementations Dashboard | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pull-outputs: | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
matrix: | ||
target: ["singulargarden/kubo", "singulargarden/bifrost-gateway2"] | ||
fail-fast: false | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: get default branch | ||
id: get-default-branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OWNER_AND_REPO: ${{ matrix.target }} | ||
run: | | ||
DEFAULT_BRANCH=$(gh api repos/{owner}/{repo} --jq '.default_branch') | ||
echo "default-branch=${DEFAULT_BRANCH}" >> $GITHUB_OUTPUT | ||
- name: Download json output | ||
id: download-artifact | ||
uses: dawidd6/action-download-artifact@v2 # TODO: pin | ||
with: | ||
workflow: gateway-conformance.yml | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ steps.get-default-branch.outputs.default-branch }} | ||
name: gateway-conformance.json | ||
repo: ${{ matrix.target }} | ||
if_no_artifact_found: fail | ||
- name: debug | ||
run: | | ||
ls ./ | ||
ls ./**/* | ||
- name: Upload JSON output | ||
if: (failure() || success()) | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: conformance-${{ matrix.target }}.json | ||
path: ./gateway-conformance.json/output.json | ||
aggregate: | ||
runs-on: "ubuntu-latest" | ||
needs: [pull-outputs] | ||
# the tests might have failed | ||
if: always() | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
path: "gateway-conformance" | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: artifacts | ||
- name: Aggregate results | ||
working-directory: ./artifacts | ||
run: | | ||
mkdir ./aggregates | ||
# download-artifact downloads artifacts in a directory named after the artifact | ||
# details: https://github.com/actions/download-artifact#download-all-artifacts | ||
for folder in ./conformance-*.json; do | ||
file="${folder}/output.json" | ||
new_file="aggregates/${folder#conformance-}" | ||
jq -ns 'inputs' "$file" | node ../gateway-conformance/aggregate.js 1 > "${new_file}" | ||
done | ||
node ../gateway-conformance/aggregate-into-table.js ./aggregates/*.json > ./table.md | ||
- name: Set summary | ||
if: (failure() || success()) | ||
run: cat ./artifacts/table.md >> $GITHUB_STEP_SUMMARY |