Skip to content

Commit

Permalink
ci: Added rudimentary CI pipeline running unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orlowskilp committed Oct 12, 2024
1 parent c8f0442 commit 448f457
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 10 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: evm-signer-kms

on:
push:
branches:
- master
- feat/**
- fix/**
- chore/**
- ci/**

pull_request:
branches:
- master

jobs:
run-tests:
name: Execute tests and measure coverage
runs-on: ubuntu-latest
env:
LCOV_UT_OUT: unit-test-cov.lcov
LCOV_IT_OUT: integration-test-cov.lcov
steps:
- uses: actions/checkout@v2

- name: Install llvm-cov for code coverage
uses: taiki-e/install-action@cargo-llvm-cov

- name: Run unit tests and measure coverage
env:
LLVM_COV_ARGS: --lcov --output-path ${{ env.LCOV_UT_OUT }} --lib
run: make test-coverage ARGS="${{ env.LLVM_COV_ARGS }}"

# - name: Run integration tests and measure coverage
# env:
# LLVM_COV_ARGS: --lcov --output-path ${{ env.LCOV_IT_OUT }} --tests
# run: make test-coverage ARGS="${{ env.LLVM_COV_ARGS }}"

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files:
${{ env.LCOV_UT_OUT }}
# ${{ env.LCOV_IT_OUT }}
fail_ci_if_error: true

build-x86-gnu:
name: Build for x86_64-unknown-linux-gnu
env:
TOOL_CHAIN : x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build for ${{ env.TOOL_CHAIN }}
env:
ARGS: --target=${{ env.TOOL_CHAIN }}
run: make ARGS=${{ env.ARGS }} build

build-x86-musl:
name: Build for x86_64-unknown-linux-musl
env:
TOOL_CHAIN : x86_64-unknown-linux-musl
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install musl toolchain
run: |
sudo apt install musl-tools
rustup target add --toolchain stable ${{ env.TOOL_CHAIN }}
- name: Build for ${{ env.TOOL_CHAIN }}
env:
ARGS: --target=${{ env.TOOL_CHAIN }}
run: make ARGS=${{ env.ARGS }} build
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build
build:
cargo build --release
cargo build $(ARGS) --release

.PHONY: doc
doc:
Expand All @@ -12,20 +12,20 @@ test:
cargo fmt
cargo test --lib --tests

.PHONY: test_coverage
test_coverage:
cargo llvm-cov
.PHONY: test-coverage
test-coverage:
cargo llvm-cov $(ARGS)

.PHONY: doc_test
doc_test:
.PHONY: test-doc
doc-test:
cargo test --doc

.PHONY: unit_test
unit_test:
.PHONY: unit-test
unit-test:
cargo test --lib

.PHONY: integration_tests
integration_test:
.PHONY: integration-tests
integration-test:
cargo test --tests

.PHONY: clean
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Library for EVM transaction signing with AWS KMS

[![MIT License](https://img.shields.io/badge/license-MIT-green)](/LICENSE)
[![evm-signer-kms](https://github.com/orlowskilp/evm-signer-kms/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/orlowskilp/evm-signer-kms/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/github/orlowskilp/evm-signer-kms/graph/badge.svg?token=DGY9EZFV5L)](https://codecov.io/github/orlowskilp/evm-signer-kms)

EVM transaction signing library using key pairs generated and stored in
[AWS KMS](https://aws.amazon.com/kms).
Expand Down

0 comments on commit 448f457

Please sign in to comment.