-
Notifications
You must be signed in to change notification settings - Fork 40
111 lines (90 loc) · 2.75 KB
/
e2e-tests.yml
File metadata and controls
111 lines (90 loc) · 2.75 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
name: E2E Integration Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
GO_VERSION: "1.25.8"
CGO_ENABLED: 0
DOCKER_BUILDKIT: 1
GO_BUILD_FLAGS: -trimpath -ldflags="-s -w"
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- id: cache-key
run: echo "key=${{ runner.os }}-binaries-${{ hashFiles('**/go.sum', '**/*.go') }}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: cache-binaries
with:
path: |
./mpcium
./mpcium-cli
key: ${{ steps.cache-key.outputs.key }}
- if: steps.cache-binaries.outputs.cache-hit != 'true'
run: cd e2e && go mod tidy
- if: steps.cache-binaries.outputs.cache-hit != 'true'
run: |
go build ${{ env.GO_BUILD_FLAGS }} -o mpcium ./cmd/mpcium
go build ${{ env.GO_BUILD_FLAGS }} -o mpcium-cli ./cmd/mpcium-cli
chmod +x mpcium mpcium-cli
e2e:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
testcase: [TestKeyGeneration, TestSigning, TestResharing, TestCKDSigning]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: "**/go.sum"
- uses: docker/setup-buildx-action@v3
- run: docker --version && docker compose version
- uses: actions/cache@v4
with:
path: |
./mpcium
./mpcium-cli
key: ${{ needs.build.outputs.cache-key }}
- run: sudo mv mpcium /usr/local/bin/ && sudo mv mpcium-cli /usr/local/bin/
- run: which mpcium && which mpcium-cli
- run: cd e2e && go mod tidy
- name: Run ${{ matrix.testcase }} E2E tests
run: |
cd e2e
go test -v -timeout=1200s -run ${{ matrix.testcase }}
- name: Upload test logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-${{ matrix.testcase }}-test-logs
path: e2e/logs/
retention-days: 7
summary:
runs-on: ubuntu-latest
needs: e2e
if: always()
steps:
- run: |
echo "E2E Test Results Summary:"
echo "========================="
echo "Matrix job status: ${{ needs.e2e.result }}"
if [[ "${{ needs.e2e.result }}" == "success" ]]; then
echo "✅ All E2E tests passed successfully"
else
echo "❌ One or more E2E tests failed"
exit 1
fi