-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (110 loc) · 3.23 KB
/
Copy pathtest.yml
File metadata and controls
130 lines (110 loc) · 3.23 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
MIX_ENV: test
ELIXIR_VERSION: "1.18.4"
OTP_VERSION: "27.2"
jobs:
test:
name: Test (Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}})
runs-on: ubuntu-latest
strategy:
matrix:
elixir: ["1.18.4", "1.19.1"]
otp: ["27.2", "28.1"]
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
env:
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 9000:9000
- 8123:8123
options: >-
--health-cmd "clickhouse-client --query 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Install system dependencies
run: |
sudo apt-get install -y build-essential cmake libssl-dev
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ matrix.otp }}-${{ matrix.elixir }}-
- name: Install dependencies
run: mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
- name: Check formatting
run: mix format --check-formatted
- name: Run tests
run: mix test --exclude integration
env:
CLICKHOUSE_HOST: localhost
CLICKHOUSE_PORT: 9000
valgrind:
name: Memory Leak Check (Valgrind)
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
env:
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
ports:
- 9000:9000
- 8123:8123
options: >-
--health-cmd "clickhouse-client --query 'SELECT 1'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build Docker image for valgrind
run: docker build -f Dockerfile.valgrind -t natch-valgrind .
- name: Run valgrind tests
run: |
docker run --rm \
--network host \
natch-valgrind 2>&1 | tee valgrind_output.txt
- name: Check for memory leaks
run: |
if grep -q "definitely lost:" valgrind_output.txt; then
echo "❌ Memory leaks detected!"
grep "definitely lost:" valgrind_output.txt
exit 1
else
echo "✅ No memory leaks detected"
fi
- name: Upload valgrind report
if: always()
uses: actions/upload-artifact@v4
with:
name: valgrind-report
path: valgrind_output.txt
retention-days: 7