Skip to content

Commit 0af5a1d

Browse files
ci: enable GitHub actions
1 parent 51fa905 commit 0af5a1d

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
on:
3+
push:
4+
branches: [ master, develop, release/* ]
5+
pull_request:
6+
branches: [ master, release/* ]
7+
defaults:
8+
run:
9+
shell: bash
10+
env:
11+
CARGO_TERM_COLOR: always
12+
RUST_TOOLCHAIN: 1.76.0
13+
jobs:
14+
rustfmt:
15+
name: Checks / Format
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout the Repository
19+
uses: actions/checkout@v4
20+
- name: Install Rust Toolchain
21+
run: |
22+
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component rustfmt
23+
rustup override set ${{ env.RUST_TOOLCHAIN }}
24+
- name: Format Check
25+
run: make fmt
26+
clippy:
27+
name: Checks / Clippy
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout the Repository
31+
uses: actions/checkout@v4
32+
- name: Install Rust Toolchain
33+
run: |
34+
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component clippy
35+
rustup override set ${{ env.RUST_TOOLCHAIN }}
36+
- name: Lint Check
37+
run: make clippy
38+
test:
39+
name: Tests / Build & Test
40+
needs: [ rustfmt, clippy ]
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
matrix:
44+
os: [ ubuntu-latest, macos-latest, windows-latest ]
45+
fail-fast: true
46+
max-parallel: 3
47+
steps:
48+
- name: Checkout the Repository
49+
uses: actions/checkout@v4
50+
with:
51+
submodules: recursive
52+
- name: Install Rust Toolchain
53+
run: |
54+
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal
55+
rustup override set ${{ env.RUST_TOOLCHAIN }}
56+
- name: Install cargo-nextest
57+
uses: taiki-e/install-action@nextest
58+
- name: Build
59+
run: make build
60+
- name: Unit Testing
61+
run: make test

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
CARGO := @cargo
22

3+
NEXTEST_RUN_ARGS := --no-fail-fast --success-output immediate --failure-output final
4+
35
#
46
# Check
57
#
@@ -13,6 +15,9 @@ fmt:
1315
clippy:
1416
${CARGO} clippy --workspace --tests -- --deny warnings
1517

18+
test:
19+
${CARGO} nextest run ${NEXTEST_RUN_ARGS} --workspace types::extension::packed::test_service
20+
1621
#
1722
# Build
1823
#

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CKB Bitcoin SPV Service
22

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

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

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

1416
## Usage
1517

0 commit comments

Comments
 (0)