Skip to content

Commit dd41aca

Browse files
author
hydepwns
committed
Separate Gleam wrapper tests into dedicated CI workflow
- Create new .github/workflows/gleam-ci.yml for Gleam wrapper testing - Configure as manual trigger only (workflow_dispatch) with disabled default - Remove Gleam testing from main CI pipeline (ci.yml) - Main CI now only tests Elixir wrapper, keeping it focused and faster - Gleam tests can be enabled manually when needed for development/debugging
1 parent ba9923c commit dd41aca

2 files changed

Lines changed: 97 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
strategy:
129129
fail-fast: false
130130
matrix:
131-
wrapper: [elixir, gleam]
131+
wrapper: [elixir]
132132

133133
steps:
134134
- uses: actions/checkout@v4.1.1
@@ -142,12 +142,7 @@ jobs:
142142
install-hex: true
143143
install-rebar: true
144144

145-
- name: Install Gleam
146-
if: matrix.wrapper == 'gleam'
147-
run: |
148-
curl -sSL https://github.com/gleam-lang/gleam/releases/download/v1.11.0/gleam-v1.11.0-x86_64-unknown-linux-musl.tar.gz | tar -xz
149-
sudo mv gleam /usr/local/bin/
150-
gleam --version
145+
151146

152147
- name: Install system dependencies
153148
run: |
@@ -202,33 +197,7 @@ jobs:
202197
mix test --trace --max-failures 1 || echo "Tests failed but continuing CI"
203198
}
204199
205-
- name: Test Gleam wrapper
206-
if: matrix.wrapper == 'gleam'
207-
run: |
208-
cd wrappers/gleam
209-
# Copy NIF files to wrapper priv directory
210-
mkdir -p priv
211-
cp -f ../../priv/*.so priv/ 2>/dev/null || cp -f ../../priv/*.dylib priv/ 2>/dev/null || cp -f ../../priv/*.dll priv/ 2>/dev/null || echo "No NIF files found to copy"
212-
ls -la priv/
213-
echo "Downloading dependencies..."
214-
gleam deps download
215-
echo "Building..."
216-
gleam build || {
217-
echo "Build failed, checking for dependency issues..."
218-
echo "Gleam version: $(gleam --version)"
219-
echo "Dependencies:"
220-
cat gleam.toml
221-
echo "Retrying build..."
222-
gleam build
223-
}
224-
echo "Running tests..."
225-
gleam test || {
226-
echo "Tests failed, checking for NIF loading issues..."
227-
echo "Available NIF files:"
228-
find ../../ -name "*.so" -o -name "*.dylib" -o -name "*.dll" | head -10
229-
echo "Continuing with build verification..."
230-
gleam check
231-
}
200+
232201

233202
security:
234203
name: Security scan
@@ -334,20 +303,6 @@ jobs:
334303
cd wrappers/elixir
335304
mix deps.get
336305
mix hex.publish --yes
337-
338-
- name: Install Gleam for publishing
339-
run: |
340-
curl -sSL https://github.com/gleam-lang/gleam/releases/download/v1.11.0/gleam-v1.11.0-x86_64-unknown-linux-musl.tar.gz | tar -xz
341-
sudo mv gleam /usr/local/bin/
342-
gleam --version
343-
344-
- name: Publish Gleam package
345-
env:
346-
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
347-
run: |
348-
cd wrappers/gleam
349-
gleam deps download
350-
gleam publish --yes
351306
352307
docker:
353308
name: Build and test Docker images

.github/workflows/gleam-ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Gleam Wrapper CI
2+
3+
# Disabled for now - only manual trigger
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
enable_gleam_tests:
8+
description: 'Enable Gleam wrapper tests'
9+
required: true
10+
default: 'false'
11+
type: choice
12+
options:
13+
- 'true'
14+
- 'false'
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
MIX_ENV: test
19+
20+
jobs:
21+
test-gleam-wrapper:
22+
name: Test Gleam wrapper
23+
runs-on: ubuntu-latest
24+
# Only run if manually enabled
25+
if: github.event.inputs.enable_gleam_tests == 'true'
26+
27+
steps:
28+
- uses: actions/checkout@v4.1.1
29+
30+
- name: Setup Erlang/OTP and Elixir
31+
uses: erlef/setup-beam@v1.18.0
32+
with:
33+
otp-version: '26.2'
34+
elixir-version: '1.15.7'
35+
rebar3-version: '3.22.1'
36+
install-hex: true
37+
install-rebar: true
38+
39+
- name: Install Gleam
40+
run: |
41+
curl -sSL https://github.com/gleam-lang/gleam/releases/download/v1.11.0/gleam-v1.11.0-x86_64-unknown-linux-musl.tar.gz | tar -xz
42+
sudo mv gleam /usr/local/bin/
43+
gleam --version
44+
45+
- name: Install system dependencies
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y libsodium-dev cmake build-essential pkg-config
49+
# Verify installations
50+
cmake --version
51+
pkg-config --exists libsodium && echo "libsodium found" || echo "libsodium not found"
52+
53+
- name: Build main NIF
54+
run: |
55+
echo "Building main NIF..."
56+
# First compile Erlang components to ensure NIF is built
57+
rebar3 compile
58+
# Then build C components
59+
cd c_src
60+
cmake . -DCMAKE_BUILD_TYPE=Release
61+
make
62+
cd ..
63+
ls -la priv/
64+
echo "NIF files built:"
65+
find priv/ -name "*.so" -o -name "*.dll" -o -name "*.dylib" | head -10
66+
echo "Erlang beam files:"
67+
find _build/ -name "*.beam" | grep libsignal | head -10
68+
69+
- name: Test Gleam wrapper
70+
run: |
71+
cd wrappers/gleam
72+
# Copy NIF files to wrapper priv directory
73+
mkdir -p priv
74+
cp -f ../../priv/*.so priv/ 2>/dev/null || cp -f ../../priv/*.dylib priv/ 2>/dev/null || cp -f ../../priv/*.dll priv/ 2>/dev/null || echo "No NIF files found to copy"
75+
ls -la priv/
76+
echo "Downloading dependencies..."
77+
gleam deps download
78+
echo "Building..."
79+
gleam build || {
80+
echo "Build failed, checking for dependency issues..."
81+
echo "Gleam version: $(gleam --version)"
82+
echo "Dependencies:"
83+
cat gleam.toml
84+
echo "Retrying build..."
85+
gleam build
86+
}
87+
echo "Running tests..."
88+
gleam test || {
89+
echo "Tests failed, checking for NIF loading issues..."
90+
echo "Available NIF files:"
91+
find ../../ -name "*.so" -o -name "*.dylib" -o -name "*.dll" | head -10
92+
echo "Continuing with build verification..."
93+
gleam check
94+
}

0 commit comments

Comments
 (0)