Skip to content

Commit

Permalink
created action to run tests and show results in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JannesNebendahl committed Jul 29, 2024
1 parent 4ade1a8 commit d7abf24
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
testing:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 'stable'

- name: Install dependencies
run: dart pub get

- name: Run tests
run: dart test --coverage=coverage

- name: Install lcov
run: sudo apt-get install -y lcov

- name: Generate coverage report
run: |
dart pub global activate coverage
dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Tests](https://github.com/JannesNebendahl/dilithium/actions/workflows/dart.yml/badge.svg)](https://github.com/JannesNebendahl/dilithium/actions/workflows/dart.yml)
[![codecov](https://codecov.io/github/JannesNebendahl/dilithium/graph/badge.svg?token=22U0DA66BD)](https://codecov.io/github/JannesNebendahl/dilithium)
Dart implementation of the [Dilithium](https://www.pq-crystals.org/dilithium/) signature scheme, which supports all 3 security levels (2, 3, 5)

## Usage
Expand Down Expand Up @@ -34,8 +36,8 @@ In order to instantiate the keys from a byte representation, the `.deserialize(s
Uint8List encodedPublicKey = keyPair.publicKey.serialize();
Uint8List encodedPrivateKey = keyPair.privateKey.serialize();
DilithiumPublicKey reinstantiatedPublicKey = DilithiumPublicKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPublicKey);
DilithiumPrivateKey reinstantiatedPrivateKey = DilithiumPrivateKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPrivateKey);
final reinstantiatedPk = DilithiumPublicKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPublicKey);
final reinstantiatedSk = DilithiumPrivateKey.deserialize(DilithiumParameterSpec.LEVEL3, encodedPrivateKey);
```

## What is Dilithium
Expand Down

0 comments on commit d7abf24

Please sign in to comment.