Skip to content

Commit

Permalink
ci: introduce test-implementations-e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Aug 21, 2023
1 parent 6c7ffe3 commit b466645
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/test-implementations-e2e.yml
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

0 comments on commit b466645

Please sign in to comment.