Repository navigation
134 lines (118 loc) · 4.42 KB
/
Copy pathperformance.yml
File metadata and controls
134 lines (118 loc) · 4.42 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
name: performance
permissions: # Principle of least privilege
contents: read
actions: read
on:
push:
branches: [nightly]
jobs:
performance-benchmarks:
runs-on: ubuntu-latest
env:
BUILD_MODE: release
RUST_BACKTRACE: 1
SCCACHE_CACHE_SIZE: 1G
services:
redis:
image: public.ecr.aws/docker/library/redis:7.4.5-alpine3.21
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: public.ecr.aws/docker/library/postgres:16.4-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DB: nautilus
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
# https://github.com/step-security/harden-runner
- uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout repository
# https://github.com/actions/checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
fetch-depth: 1
- name: Aggressive disk cleanup (pre-setup)
if: runner.os == 'Linux'
run: |
set -euxo pipefail
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost || true
sudo rm -rf /usr/local/lib/android /usr/lib/jvm /usr/lib/mono || true
sudo rm -rf /opt/hostedtoolcache/go /opt/hostedtoolcache/node || true
if [ -n "${AGENT_TOOLSDIRECTORY:-}" ] && [ -d "$AGENT_TOOLSDIRECTORY" ]; then
# Remove big toolcache components but keep Python intact
sudo rm -rf "$AGENT_TOOLSDIRECTORY/CodeQL" \
"$AGENT_TOOLSDIRECTORY/Go" \
"$AGENT_TOOLSDIRECTORY/Node" \
"$AGENT_TOOLSDIRECTORY/node" \
"$AGENT_TOOLSDIRECTORY/Ruby" \
"$AGENT_TOOLSDIRECTORY/PyPy" \
"$AGENT_TOOLSDIRECTORY/R" \
"$AGENT_TOOLSDIRECTORY"/Java* || true
fi
sudo apt-get clean
sudo apt-get autoremove -y
sudo rm -rf /var/lib/apt/lists/* /usr/share/man /usr/share/doc || true
df -h
- name: Common setup
uses: ./.github/actions/common-setup
with:
python-version: "3.12"
free-disk-space: "true"
- name: Prune unused Docker images
if: runner.os == 'Linux'
run: |
docker image prune -a -f || true
- name: Install Nautilus CLI
env:
NAUTILUS_CLI_FORCE_SOURCE: ${{ github.ref == 'refs/heads/nightly' && '1' || '0' }}
run: bash scripts/ci/install-nautilus-cli.sh
- name: Init postgres schema
run: nautilus database init --schema ${{ github.workspace }}/schema/sql
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: pass
POSTGRES_DATABASE: nautilus
- name: Run Rust tests
run: make cargo-test
# TODO: Add nautilus-persistence once required test data available
- name: Run Rust benchmarks crate-by-crate
env:
# Shrink bench artifacts to reduce disk usage
RUSTFLAGS: -Cdebuginfo=0
CARGO_PROFILE_BENCH_DEBUG: 0
CARGO_PROFILE_BENCH_INCREMENTAL: false
run: make cargo-ci-benches
- name: Build and install wheel
uses: ./.github/actions/common-wheel-build
with:
python-version: "3.12"
github_ref: ${{ github.ref }}
- name: Cleanup build artifacts and caches
if: runner.os == 'Linux'
run: |
set -euxo pipefail
rm -rf target || true
rm -rf ~/.cargo/registry ~/.cargo/git || true
uv cache prune || true
rm -rf dist build || true
# Run codspeed once only
- name: Run benchmarks
# https://github.com/CodSpeedHQ/action
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
with:
token: ${{ secrets.CODSPEED_TOKEN }}
mode: instrumentation
run: uv run --no-sync pytest tests/performance_tests --benchmark-disable-gc --codspeed