-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (109 loc) · 3.87 KB
/
Copy pathpicofuzz.yml
File metadata and controls
121 lines (109 loc) · 3.87 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
name: Picofuzz Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
version:
description: 'typeberry version: `next` (default), `<semver>-<sha>` (pre-release), or `<semver>` (release)'
required: false
default: 'next'
backend:
description: 'State backend: fjall, lmdb, fjall-hybrid, lmdb-hybrid (default: version default)'
required: false
default: ''
repository_dispatch:
schedule:
# 2x/day (reduced from 5x) — staggered overnight to relieve the single shared self-hosted runner.
# 20:00 Europe/Warsaw = 18:00 UTC (UTC+2 summer)
- cron: '0 18 * * *'
# 05:00 Europe/Warsaw = 03:00 UTC (UTC+2 summer)
- cron: '0 3 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
init:
name: Initializing environment
runs-on: [self-hosted, perf]
steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Provision Typeberry image
uses: ./.github/actions/provision-typeberry
with:
target: docker
version: ${{ github.event.inputs.version || 'next' }}
- name: Build picofuzz
run: npm run build-docker -w @fluffylabs/picofuzz
picofuzz:
needs: init
name: Picofuzz Test
runs-on: [self-hosted, perf]
strategy:
fail-fast: false
matrix:
test: [fallback, safrole, storage, storage_light, conformance]
steps:
- uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Get previous run ID
id: previous-run
run: |
WORKFLOW_ID=$(curl -s \
-H "Authorization: token $GH_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$GH_REPO/actions/workflows" \
| jq -r '.workflows[] | select(.name == "Picofuzz Tests") | .id')
PREVIOUS_RUN_ID=$(curl -s \
-H "Authorization: token $GH_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/$GH_REPO/actions/workflows/$WORKFLOW_ID/runs?branch=main&status=success&per_page=2" \
| jq -r '.workflow_runs[1].id')
echo "run-id=$PREVIOUS_RUN_ID" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
- run: mkdir ./picofuzz-result && chmod 777 ./picofuzz-result
- name: Download previous CSV files
uses: actions/download-artifact@v8
with:
name: picofuzz-csv-${{ matrix.test }}
path: ./picofuzz-result/
github-token: ${{ secrets.ARTIFACTS_PAT }}
run-id: ${{ steps.previous-run.outputs.run-id }}
continue-on-error: true
- name: Run picofuzz ${{ matrix.test }}
run: |
npm exec tsx --test tests/picofuzz/${{ matrix.test }}.test.ts
env:
STATE_BACKEND: ${{ github.event.inputs.backend || '' }}
- name: Upload CSV results
uses: actions/upload-artifact@v7
with:
name: picofuzz-csv-${{ matrix.test }}
path: ./picofuzz-result/${{ matrix.test }}.csv
retention-days: 90
- name: Reap test containers and volumes
if: always()
run: |
docker ps -aq --filter "label=ci-run=${{ github.run_id }}" | xargs -r docker rm -f
docker volume ls -q --filter "label=ci-run=${{ github.run_id }}" | xargs -r docker volume rm -f