From 66ca095b029a03a6d21f9a3026b399cee97088e0 Mon Sep 17 00:00:00 2001 From: enkvadrat Date: Thu, 8 Jan 2026 18:50:52 +0100 Subject: [PATCH] Add Github workflow for Linux (Ubuntu) this tests that we can build successfully on Linux and also shows example of how people can build it. initialize buffers since clang gives compile error (may be a false positive) --- .github/workflows/ci.yml | 54 ++++++++++++++++++++++++++++++++++++++++ dev/tabedit/columns5.c | 8 +++--- 2 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c965558 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: Linux Build Check +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-linux: + name: Ubuntu Build (PortAudio v19.6) + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Cache APT Packages + uses: actions/cache@v4 + with: + path: /var/cache/apt/archives + key: ${{ runner.os }}-apt-${{ hashFiles('.github/workflows/linux-build.yml') }} + restore-keys: | + ${{ runner.os }}-apt- + + - name: Install System Dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake ninja-build \ + portaudio19-dev libasound2-dev \ + clang libc++-dev libc++abi-dev ccache + + - name: Setup ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + key: ${{ runner.os }}-ccache-${{ hashFiles('**/*.c', '**/*.cpp', '**/*.h') }} + restore-keys: | + ${{ runner.os }}-ccache- + + - name: Configure CMake + # Ninja is used for faster build orchestration than standard Make. + run: > + cmake -B build -G Ninja + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + -DCMAKE_C_COMPILER=clang + -DCMAKE_CXX_COMPILER=clang++ + -DCMAKE_BUILD_TYPE=Release + + - name: Build Project + run: cmake --build build --config Release + + - name: Show ccache stats + run: ccache -s diff --git a/dev/tabedit/columns5.c b/dev/tabedit/columns5.c index 1685188..e96c4d7 100755 --- a/dev/tabedit/columns5.c +++ b/dev/tabedit/columns5.c @@ -950,7 +950,7 @@ void format_vals(void) int n, m, OK = 1; double d = (double)cnt/(double)ifactor; int rowcnt = cnt/ifactor; - char ctemp[64]; + char ctemp[64] = {0}; errstr[0] = ENDOFSTR; if(d > (double)rowcnt) @@ -998,7 +998,7 @@ void column_format_vals(void) double d = (double)cnt/(double)ifactor; int rowcnt = cnt/ifactor; - char ctemp[64]; + char ctemp[64] = {0}; errstr[0] = ENDOFSTR; if(d > (double)rowcnt) rowcnt++; @@ -2865,7 +2865,7 @@ void format_strs(void) int n, m, OK = 1; double d = (double)stringscnt/(double)ifactor; int rowcnt = stringscnt/ifactor; - char ctemp[64]; + char ctemp[64] = {0}; errstr[0] = ENDOFSTR; if(d > (double)rowcnt) rowcnt++; @@ -2896,7 +2896,7 @@ void column_format_strs(void) double d = (double)stringscnt/(double)ifactor; int rowcnt = stringscnt/ifactor; - char ctemp[64]; + char ctemp[64] = {0}; errstr[0] = ENDOFSTR; if(d > (double)rowcnt) rowcnt++;