-
Notifications
You must be signed in to change notification settings - Fork 5
174 lines (157 loc) · 6.48 KB
/
test-dkls23-build.yml
File metadata and controls
174 lines (157 loc) · 6.48 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Test dkls23-rs Build
on:
workflow_dispatch: # Manual trigger - can be run manually from any branch
push:
# Trigger on push to any branch when workflow file or related files change
paths:
- '.github/workflows/test-dkls23-build.yml'
- 'go.mod'
- 'Makefile'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GO_VERSION: 1.22.3
jobs:
test-dkls23-build:
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Configure Git for private repos
env:
CI_DKLS_GARBLING: ${{ secrets.CI_DKLS_GARBLING }}
run: |
# Configure git to use HTTPS
git config --global url."https://github.com/".insteadOf "git@github.com:"
# Configure credential helper to use PAT token with dkls/garbling access
git config --global credential.helper store
# Store credentials for git operations using PAT with dkls access
echo "https://${CI_DKLS_GARBLING}@github.com" > ~/.git-credentials
chmod 600 ~/.git-credentials
# Verify git config
git config --global --list | grep -E "(url|credential)" || true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: Install Rust (for dkls23-rs dependency)
uses: dtolnay/rust-toolchain@stable
- name: Test clone dkls23-rs repository
env:
CI_DKLS_GARBLING: ${{ secrets.CI_DKLS_GARBLING }}
run: |
echo "Testing access to private dkls23-rs repository..."
# Try to clone the private repo using PAT with dkls access
if git clone --depth 1 https://${CI_DKLS_GARBLING}@github.com/pushchain/dkls23-rs.git ../dkls23-rs; then
echo "✅ Successfully cloned dkls23-rs repository"
ls -la ../dkls23-rs/ || true
else
echo "❌ Failed to clone dkls23-rs repository"
echo "Checking if directory exists..."
ls -la ../ || true
exit 1
fi
- name: Build dkls23-rs dependency
env:
CI_DKLS_GARBLING: ${{ secrets.CI_DKLS_GARBLING }}
run: |
echo "Building dkls23-rs dependency..."
if [ ! -d "../dkls23-rs" ]; then
echo "❌ dkls23-rs directory not found"
exit 1
fi
# Check if header file exists
if [ -f "../dkls23-rs/wrapper/go-wrappers/../go-dkls/include/go-dkls.h" ]; then
echo "✅ Header file already exists, skipping build"
else
echo "Building dkls23-rs..."
cd ../dkls23-rs/wrapper/go-wrappers
make build || {
echo "❌ Failed to build dkls23-rs"
echo "Checking Rust/Cargo setup..."
cargo --version || echo "Cargo not found"
rustc --version || echo "Rustc not found"
exit 1
}
fi
# Verify build artifacts
if [ -f "../dkls23-rs/target/release/libgodkls.dylib" ] || \
[ -f "../dkls23-rs/target/release/libgodkls.so" ] || \
[ -f "../dkls23-rs/target/release/libgodkls.a" ]; then
echo "✅ Build artifacts found"
ls -la ../dkls23-rs/target/release/libgodkls.* || true
else
echo "⚠️ Build artifacts not found in expected location"
echo "Searching for build artifacts..."
find ../dkls23-rs/target -name "libgodkls.*" 2>/dev/null || echo "No libgodkls files found"
fi
- name: Verify go.mod replace directive
run: |
echo "Checking go.mod replace directive..."
if grep -q "go-wrapper => \.\.\/dkls23-rs" go.mod; then
echo "✅ go.mod has correct replace directive"
grep "go-wrapper =>" go.mod
else
echo "⚠️ go.mod replace directive not found or incorrect"
grep "go-wrapper" go.mod || echo "No go-wrapper entry found"
fi
- name: Test go mod download
run: |
echo "Testing go mod download with dkls23-rs..."
if go mod download; then
echo "✅ go mod download succeeded"
else
echo "❌ go mod download failed"
exit 1
fi
- name: Test go mod verify
run: |
echo "Verifying go modules..."
if go mod verify; then
echo "✅ go mod verify succeeded"
else
echo "⚠️ go mod verify failed (may be expected with local replace)"
fi
- name: Test building a TSS package
run: |
echo "Testing if we can build a TSS package..."
# Try to build a simple TSS package to verify everything works
if go build -o /dev/null ./universalClient/tss/coordinator 2>&1; then
echo "✅ Successfully built TSS coordinator package"
else
echo "⚠️ Failed to build TSS coordinator (this may be expected if CGO is required)"
echo "Build output:"
go build -o /dev/null ./universalClient/tss/coordinator 2>&1 || true
fi
- name: Summary
if: always()
run: |
echo "## Build Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Repository Access" >> $GITHUB_STEP_SUMMARY
if [ -d "../dkls23-rs" ]; then
echo "✅ dkls23-rs repository cloned successfully" >> $GITHUB_STEP_SUMMARY
else
echo "❌ dkls23-rs repository not found" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Build Status" >> $GITHUB_STEP_SUMMARY
if [ -f "../dkls23-rs/target/release/libgodkls.dylib" ] || \
[ -f "../dkls23-rs/target/release/libgodkls.so" ] || \
[ -f "../dkls23-rs/target/release/libgodkls.a" ]; then
echo "✅ Build artifacts found" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ Build artifacts not found" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Go Module Status" >> $GITHUB_STEP_SUMMARY
if go mod download 2>&1 | grep -q "go-wrapper"; then
echo "✅ go mod download works with go-wrapper" >> $GITHUB_STEP_SUMMARY
else
echo "⚠️ go mod download may have issues" >> $GITHUB_STEP_SUMMARY
fi