Skip to content

Commit

Permalink
custom test badge (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
chrisdukakis and github-actions authored Feb 21, 2024
1 parent f5faaca commit 1b6f808
Show file tree
Hide file tree
Showing 5 changed files with 733 additions and 647 deletions.
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

0 comments on commit 1b6f808

Please sign in to comment.