Skip to content

Commit 04f5f40

Browse files
author
Omer Bulut
committed
fix: add environment variables to cross-compiler jobs to fix -Weverything flag issue
1 parent 24453e1 commit 04f5f40

1 file changed

Lines changed: 61 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -89,65 +89,95 @@ jobs:
8989
path: security-report/
9090
retention-days: 30
9191

92-
# Phase 1: Cross-Compiler Testing
92+
# Phase 2: Cross-Compiler Testing
9393
cross-compiler:
94-
name: Cross-Compiler Testing
94+
name: Cross-Compiler Testing (gcc-11)
9595
runs-on: ubuntu-latest
96-
strategy:
97-
matrix:
98-
compiler: [gcc-11, clang-14]
99-
fail-fast: false
100-
timeout-minutes: 20
96+
timeout-minutes: 15
97+
env:
98+
CXX: g++-11
99+
CXXFLAGS: -std=c++17 -Wall -Wextra -O2 -g
101100

102101
steps:
103102
- name: Checkout code
104103
uses: actions/checkout@v4
105-
with:
106-
token: ${{ secrets.GITHUB_TOKEN }}
107104

108105
- name: Install Dependencies
109106
run: |
110-
echo "🔧 Installing dependencies for ${{ matrix.compiler }}..."
107+
echo "🔧 Installing dependencies..."
111108
sudo apt-get update
112-
if [ "${{ matrix.compiler }}" = "gcc-11" ]; then
113-
sudo apt-get install -y gcc-11 g++-11 libspdlog-dev libfmt-dev libgtest-dev || echo "⚠️ Some packages could not be installed (continuing...)"
114-
else
115-
sudo apt-get install -y clang-14 libspdlog-dev libfmt-dev libgtest-dev || echo "⚠️ Some packages could not be installed (continuing...)"
116-
fi
109+
sudo apt-get install -y build-essential libspdlog-dev libfmt-dev libgtest-dev gcc-11 g++-11 || echo "⚠️ Some packages could not be installed (continuing...)"
117110
118111
- name: Setup Compiler
119112
run: |
120-
echo "🔧 Setting up ${{ matrix.compiler }}..."
121-
if [ "${{ matrix.compiler }}" = "gcc-11" ]; then
122-
echo "CXX=g++-11" >> $GITHUB_ENV
123-
echo "CC=gcc-11" >> $GITHUB_ENV
124-
else
125-
echo "CXX=clang++-14" >> $GITHUB_ENV
126-
echo "CC=clang-14" >> $GITHUB_ENV
127-
fi
113+
echo "🔧 Setting up gcc-11..."
114+
export CC=gcc-11
115+
export CXX=g++-11
128116
echo "Using compiler: $CXX"
117+
echo "Using flags: $CXXFLAGS"
129118
130-
- name: Build with ${{ matrix.compiler }}
119+
- name: Build and Test
131120
run: |
132-
echo "🔨 Building with ${{ matrix.compiler }}..."
121+
echo "🔨 Building with gcc-11..."
133122
make clean
134123
make all
135124
136-
echo "✅ Build completed with ${{ matrix.compiler }}"
125+
echo "🧪 Running tests with gcc-11..."
126+
make enterprise-test
127+
128+
echo "✅ gcc-11 build and tests completed"
129+
130+
- name: Upload Test Results
131+
uses: actions/upload-artifact@v4
132+
if: always()
133+
with:
134+
name: gcc-11-test-results
135+
path: test_logs/
136+
retention-days: 30
137+
138+
# Phase 2: Clang-14 Testing
139+
clang-testing:
140+
name: Cross-Compiler Testing (clang-14)
141+
runs-on: ubuntu-latest
142+
timeout-minutes: 15
143+
env:
144+
CXX: clang++-14
145+
CXXFLAGS: -std=c++17 -Wall -Wextra -O2 -g
146+
147+
steps:
148+
- name: Checkout code
149+
uses: actions/checkout@v4
150+
151+
- name: Install Dependencies
152+
run: |
153+
echo "🔧 Installing dependencies..."
154+
sudo apt-get update
155+
sudo apt-get install -y build-essential libspdlog-dev libfmt-dev libgtest-dev clang-14 || echo "⚠️ Some packages could not be installed (continuing...)"
156+
157+
- name: Setup Compiler
158+
run: |
159+
echo "🔧 Setting up clang-14..."
160+
export CC=clang-14
161+
export CXX=clang++-14
162+
echo "Using compiler: $CXX"
163+
echo "Using flags: $CXXFLAGS"
137164
138-
- name: Run Tests with ${{ matrix.compiler }}
165+
- name: Build and Test
139166
run: |
140-
echo "🧪 Running tests with ${{ matrix.compiler }}..."
141-
mkdir -p test_logs
167+
echo "🔨 Building with clang-14..."
168+
make clean
169+
make all
170+
171+
echo "🧪 Running tests with clang-14..."
142172
make enterprise-test
143173
144-
echo "✅ Tests completed with ${{ matrix.compiler }}"
174+
echo "✅ clang-14 build and tests completed"
145175
146176
- name: Upload Test Results
147177
uses: actions/upload-artifact@v4
148178
if: always()
149179
with:
150-
name: test-results-${{ matrix.compiler }}
180+
name: clang-14-test-results
151181
path: test_logs/
152182
retention-days: 30
153183

0 commit comments

Comments
 (0)