Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

custom test badge #3

Merged
merged 22 commits into from
Feb 21, 2024
Merged
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
25 changes: 25 additions & 0 deletions .github/badges/test.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 46 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,58 @@ on:
- 'main'

jobs:
build:
name: build
test:
name: test
runs-on: ubuntu-latest
outputs:
epoch: ${{steps.test.outputs.epoch}}
tick: ${{steps.test.outputs.tick}}
status: ${{steps.test.outputs.status}}
color: ${{steps.test.outputs.color}}
steps:

- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- run: sudo apt-get install -y xsltproc
- run: bun install --verbose
- run: PEERS="${{secrets.PEERS}}" SEED="${{secrets.SEED}}" bun test-ci.js
- id: test
run: PEERS="${{secrets.PEERS}}" SEED="${{secrets.SEED}}" bun test-ci.js

badge:
runs-on: ubuntu-latest
needs: test
if: ${{ github.actor != 'github-actions' && (github.event_name == 'pull_request' || github.event_name == 'push') }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Create badges dir
run: mkdir -p '.github/badges/'

# Use the output from the `coverage` step
- name: Generate badge svg
uses: emibcn/badge-action@v2.0.3
id: badge
with:
label: "Test: ${{needs.test.outputs.epoch}} | ${{needs.test.outputs.tick}}"
status: ${{needs.test.outputs.status}}
color: '${{needs.test.outputs.color}}, ${{needs.test.outputs.color}}, ${{needs.test.outputs.color}}'
path: '.github/badges/test.svg'

- name: Upload badge as artifact
uses: actions/upload-artifact@v4
with:
name: badge
path: '.github/badges/test.svg'
if-no-files-found: error

- continue-on-error: true
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .github/badges/test.svg
git commit -m "generated test badge"
git push
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# qubic-lrv (lite record verification)

[![test](https://github.com/computor-tools/qubic-lrv/actions/workflows/test.yaml/badge.svg)](https://github.com/computor-tools/qubic-lrv/actions/workflows/test.yaml)
[![test](.github/badges/test.svg)](https://github.com/computor-tools/qubic-lrv/actions/workflows/test.yaml)

Uses spectrum digest and 451 quorum ticks to verify records.
Only `RESPOND_ENTITY` is supported now. Support for assets and contracts will be added later.
Expand Down
Loading