Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
* Add CI workflow

* Update README
  • Loading branch information
alfred-hodler committed Jan 25, 2024
1 parent edfde91 commit d9dd415
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 5 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

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

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libudev-dev
version: 1.0
- name: Build
run: cargo build --verbose
- name: Run tests
run: RUST_LOG=trace cargo test --verbose

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Format
run: cargo fmt --all --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libudev-dev
version: 1.0
- name: Run Clippy
run: cargo clippy
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Documentation](https://img.shields.io/docsrs/coldcard)](https://docs.rs/coldcard/latest/coldcard/)
[![Crates.io](https://img.shields.io/crates/v/coldcard.svg)](https://crates.io/crates/coldcard)
[![License](https://img.shields.io/crates/l/coldcard.svg)](https://github.com/alfred-hodler/rust-coldcard/blob/master/coldcard/LICENSE)
[![Test Status](https://github.com/alfred-hodler/rust-coldcard/actions/workflows/rust.yml/badge.svg?branch=master)](https://github.com/alfred-hodler/rust-coldcard/actions)

This is a workspace that contains crates used for interfacing with the [Coldcard](https://coldcard.com/) hardware wallet.

Expand All @@ -22,4 +23,4 @@ Contributions are welcome. Before making large changes, please open an issue fir

## Disclaimer

This is not an official project and comes with no warranty whatsoever.
This is not an official project and comes with no warranty whatsoever.
7 changes: 3 additions & 4 deletions coldcard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ let mut api = coldcard::Api::new()?;
let serials = api.detect()?;

// get the first serial and open it
let first = serials.into_iter().next().unwrap();
let (mut cc, master_xpub) = api.open(first, None).unwrap();
let (mut cc, master_xpub) = api.open(&serials[0], None)?;

// set a passphrase
coldcard.set_passphrase(protocol::Passphrase::new("secret")?)?;
Expand All @@ -33,7 +32,7 @@ coldcard.logout()?;

## Linux Specific Instructions

In order to be able to detect a Coldcard device on a Linux system, [51-coinkite.rules](../51-coinkite.rules) must be placed in `/etc/udev/rules.d/`.
In order to be able to detect a Coldcard device on a Linux system, [51-coinkite.rules](../51-coinkite.rules) must be placed in `/etc/udev/rules.d/`. This can be installed using the CLI tool.

Two mutually exclusive HID backends are supported and can be turned on using the following features:

Expand All @@ -60,4 +59,4 @@ Contributions are welcome. Before making large changes, please open an issue fir

## Disclaimer

This is not an official project and comes with no warranty whatsoever.
This is not an official project and comes with no warranty whatsoever.

0 comments on commit d9dd415

Please sign in to comment.