forked from solana-foundation/solana-private-channels
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (90 loc) · 3.08 KB
/
Copy pathprogram-unit.yml
File metadata and controls
103 lines (90 loc) · 3.08 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
name: Program Unit Tests
on:
push:
branches: [main, hardening/pre-release-audit]
paths:
- "private-channel-escrow-program/**"
- "private-channel-withdraw-program/**"
- "dvp-swap-program/**"
- "Cargo.*"
- ".github/workflows/program-unit.yml"
pull_request:
branches: [main, hardening/pre-release-audit]
paths:
- "private-channel-escrow-program/**"
- "private-channel-withdraw-program/**"
- "dvp-swap-program/**"
- "Cargo.*"
- ".github/workflows/program-unit.yml"
env:
CARGO_TERM_COLOR: always
RUST_LOG: info
permissions:
contents: read
pull-requests: write
actions: read
jobs:
unit-test:
name: Unit Tests with Coverage
runs-on: private-channel-runner-1
timeout-minutes: 40
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup environment
uses: ./.github/actions/setup-environment
with:
rust-components: llvm-tools-preview
- name: Run unit tests with coverage
run: |
echo "🧪 Running unit tests with coverage..."
make unit-coverage
- name: Generate HTML coverage report
run: |
echo "📊 Generating HTML coverage reports..."
make coverage-html
- name: Display coverage summary
run: |
echo "📈 Coverage summary will be shown by make unit-coverage"
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: unit-coverage-reports
path: |
coverage/coverage-escrow-unit.lcov
coverage/coverage-escrow-html/
coverage/coverage-withdraw-unit.lcov
coverage/coverage-withdraw-html/
coverage/coverage-dvp-swap-unit.lcov
coverage/coverage-dvp-swap-html/
if-no-files-found: warn
retention-days: 30
- name: Update PR coverage — Escrow Program
if: github.event_name == 'pull_request'
uses: ./.github/actions/update-coverage-row
with:
component: Escrow Program
lcov-file: coverage/coverage-escrow-unit.lcov
artifact-name: unit-coverage-reports
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update PR coverage — Withdraw Program
if: github.event_name == 'pull_request'
uses: ./.github/actions/update-coverage-row
with:
component: Withdraw Program
lcov-file: coverage/coverage-withdraw-unit.lcov
artifact-name: unit-coverage-reports
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Update PR coverage — DvP Swap Program
if: github.event_name == 'pull_request'
uses: ./.github/actions/update-coverage-row
with:
component: DvP Swap Program
lcov-file: coverage/coverage-dvp-swap-unit.lcov
artifact-name: unit-coverage-reports
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Show failure logs
if: failure()
uses: ./.github/actions/show-failure-logs
with:
test-type: "Program unit"