Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Dec 14, 2023
1 parent 6026e32 commit 613e0b7
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
tags:
- 'v*'
workflow_dispatch:

name: Publish

env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:
publish-round-based:
name: Publish crate
environment: crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Rust

on:
pull_request:
branches: [ "*" ]

env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Build
run: cargo build
- name: Run tests
run: cargo test --lib --tests
build-all-features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Build
run: cargo build --all-features
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Doctests
run: cargo test --doc --all-features
check-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check formatting
run: cargo fmt --all -- --check
check-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Check docs
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps
check-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Run clippy
run: cargo clippy -- -D clippy::all
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//! [BIP32]: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
#![cfg_attr(not(feature = "std"), no_std)]
#![forbid(missing_docs)]
#![forbid(missing_docs, unsafe_code)]

use core::ops;

Expand Down

0 comments on commit 613e0b7

Please sign in to comment.