Skip to content

Commit

Permalink
ci: enable GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Mar 20, 2024
1 parent 51fa905 commit 0af5a1d
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI
on:
push:
branches: [ master, develop, release/* ]
pull_request:
branches: [ master, release/* ]
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.76.0
jobs:
rustfmt:
name: Checks / Format
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component rustfmt
rustup override set ${{ env.RUST_TOOLCHAIN }}
- name: Format Check
run: make fmt
clippy:
name: Checks / Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component clippy
rustup override set ${{ env.RUST_TOOLCHAIN }}
- name: Lint Check
run: make clippy
test:
name: Tests / Build & Test
needs: [ rustfmt, clippy ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: true
max-parallel: 3
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal
rustup override set ${{ env.RUST_TOOLCHAIN }}
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Build
run: make build
- name: Unit Testing
run: make test
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
CARGO := @cargo

NEXTEST_RUN_ARGS := --no-fail-fast --success-output immediate --failure-output final

#
# Check
#
Expand All @@ -13,6 +15,9 @@ fmt:
clippy:
${CARGO} clippy --workspace --tests -- --deny warnings

test:
${CARGO} nextest run ${NEXTEST_RUN_ARGS} --workspace types::extension::packed::test_service

#
# Build
#
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CKB Bitcoin SPV Service

[![License]](#license)
[![GitHub Actions]](https://github.com/yangby-cryptape/ckb-bitcoin-spv-service/actions)

> [!WARNING]
> This repository is still in the proof-of-concept stage.
Expand All @@ -10,6 +11,7 @@ and provides an API to generate proofs for [Bitcoin] transactions so that
they can be verified on [CKB].

[License]: https://img.shields.io/badge/License-MIT-blue.svg
[GitHub Actions]: https://github.com/yangby-cryptape/ckb-bitcoin-spv-service/workflows/CI/badge.svg

## Usage

Expand Down

0 comments on commit 0af5a1d

Please sign in to comment.