-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (103 loc) · 3.62 KB
/
ci.yml
File metadata and controls
136 lines (103 loc) · 3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
pull_request:
workflow_dispatch:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
RUST_LOG_JSON: "0"
jobs:
test:
runs-on: ubuntu-ghcloud
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: rust version
run: |
rustc --version
cargo --version
- uses: taiki-e/install-action@cargo-nextest
- name: Install Bitcoin Core
env:
# Fallback version if auto-detection fails
FALLBACK_VERSION: "29.1"
run: |
# Get latest Bitcoin Core version from GitHub API
echo "Detecting latest Bitcoin Core version..."
BITCOIN_VERSION=$(curl -s https://api.github.com/repos/bitcoin/bitcoin/releases/latest | \
sed -n 's/.*"tag_name": "v\([^"]*\)".*/\1/p' || echo "$FALLBACK_VERSION")
# Validate version was detected
if [ -z "$BITCOIN_VERSION" ]; then
echo "Failed to detect version, using fallback: $FALLBACK_VERSION"
BITCOIN_VERSION="$FALLBACK_VERSION"
fi
echo "Installing Bitcoin Core v${BITCOIN_VERSION}..."
# Download Bitcoin Core
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz || {
echo "Download failed. The version ${BITCOIN_VERSION} might not be available on bitcoincore.org yet."
echo "Falling back to version ${FALLBACK_VERSION}..."
BITCOIN_VERSION="$FALLBACK_VERSION"
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
}
echo "Extracting Bitcoin Core..."
tar -xzf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
# Move bitcoind to PATH
echo "Installing Bitcoin Core binaries..."
sudo mv bitcoin-${BITCOIN_VERSION}/bin/bitcoind /usr/local/bin/
sudo mv bitcoin-${BITCOIN_VERSION}/bin/bitcoin-cli /usr/local/bin/
# Cleanup
rm -rf bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz bitcoin-${BITCOIN_VERSION}/
# Verify installation
echo "Verifying installation..."
bitcoind --version
- name: Install Sui Binary
run: .github/scripts/install-sui.sh
- name: Run tests
run: |
cargo nextest run --workspace --all-features --profile ci
cargo test --workspace --all-features --doc
- run: make is-dirty
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: rust version
run: |
rustc --version
cargo --version
- run: rustup component add rustfmt
- run: rustup component add clippy
# Install buf
- name: Install buf
uses: bufbuild/buf-setup-action@v1.24.0
with:
version: 1.47.2
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: rustfmt
run: make check-fmt
- name: clippy
run: make clippy
- run: make buf-lint
- run: make proto
- run: make is-dirty
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: rust version
run: |
rustc --version
cargo --version
- name: rustdoc
run: make doc
- uses: taiki-e/install-action@mdbook
- uses: taiki-e/install-action@v2
with:
tool: mdbook-mermaid
- name: build mdbook
run: cd design && mdbook build
- run: make is-dirty