Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add GHA spec check #1

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/spec-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Spec Check

on:
pull_request:
paths:
- 'spec.json'
- 'forest/**.json'
- 'lotus/**.json'

env:
DOCKER_IMAGE: "ghcr.io/ansermino/openrpc-checker"
DOCKER_TAG: "latest"


jobs:
spec-check:
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v3

- name: Fetch Docker image
run: docker pull ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}

- name: Run Forest check
id: forest-check
run: docker run -v "${{ github.workspace }}:/usr/src/app/input" ${{ env.DOCKER_IMAGE }} diff --ref-parser -s "./input/spec.json" -t "./input/forest/doc.json"
continue-on-error: true

- name: Run Lotus check
id: lotus-check
run: docker run -v "${{ github.workspace }}:/usr/src/app/input" ${{ env.DOCKER_IMAGE }} diff --ref-parser -s "./input/spec.json" -t "./input/lotus/doc.json"
continue-on-error: true

- name: Check results
if: steps.forest-check.outcome == 'failure' || steps.lotus-check.outcome == 'failure'
run: |
echo "Failed checks! See results above."
exit 1
Loading
Loading