@@ -27,48 +27,54 @@ jobs:
2727 - name : Checkout repository
2828 uses : actions/checkout@v4
2929 with :
30- fetch-depth : 0 # useful if you later use git describe or tags
30+ fetch-depth : 0 # helpful for any git-based versioning later
3131
3232 - name : Install build dependencies (Ubuntu)
3333 if : runner.os == 'Linux'
3434 run : |
3535 sudo apt-get update -qq
3636 sudo apt-get install -y --no-install-recommends \
37- build-essential \
38- cmake \
39- ninja-build \
40- g++-13 \
41- libstdc++-13-dev \
42- pkg-config
37+ build-essential \
38+ cmake \
39+ ninja-build \
40+ g++-13 \
41+ libstdc++-13-dev
4342
44- - name : Show directory structure (debug)
43+ - name : Verify source directory structure (debug)
4544 run : |
46- echo "Current directory:"
45+ echo "=== GITHUB_WORKSPACE ==="
46+ echo "${{ github.workspace }}"
47+ echo ""
48+ cd "${{ github.workspace }}"
4749 pwd
4850 echo ""
49- echo "Listing root contents: "
51+ echo "=== ls -la ( root) === "
5052 ls -la
5153 echo ""
52- echo "Listing cmake/ contents: "
53- ls -la cmake/ || echo "cmake/ folder NOT found!"
54+ echo "=== cmake/ folder === "
55+ ls -la cmake/ || echo "ERROR: cmake/ not found!"
5456 echo ""
55- echo "Checking CompilerOptions.cmake:"
56- ls -la cmake/CompilerOptions.cmake || echo "CompilerOptions.cmake NOT found!"
57-
58- - name : Cache build directory
59- uses : actions/cache@v4
60- with :
61- path : build
62- key : ${{ runner.os }}-build-ninja-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', 'cmake/*.cmake', 'CMakePresets.json') }}
63- restore-keys : |
64- ${{ runner.os }}-build-ninja-${{ matrix.name }}-
65-
66- - name : Configure CMake
57+ echo "=== CompilerOptions.cmake ==="
58+ ls -la cmake/CompilerOptions.cmake || echo "ERROR: cmake/CompilerOptions.cmake not found!"
59+ echo ""
60+ echo "=== Search for CompilerOptions anywhere ==="
61+ find . -type f -name CompilerOptions.cmake || echo "Not found anywhere"
62+
63+ # Temporarily disabled — re-enable after first successful run
64+ # - name: Cache build directory
65+ # uses: actions/cache@v4
66+ # with:
67+ # path: build
68+ # key: ${{ runner.os }}-build-ninja-${{ matrix.name }}-${{ hashFiles('CMakeLists.txt', '**/CMakeLists.txt', 'cmake/*.cmake', 'CMakePresets.json') }}
69+ # restore-keys: ${{ runner.os }}-build-ninja-${{ matrix.name }}-
70+
71+ - name : Configure CMake (absolute paths)
6772 env :
6873 CC : ${{ matrix.cc }}
6974 CXX : ${{ matrix.cxx }}
7075 run : |
71- cmake -S "${{ github.workspace }}" -B "${{ github.workspace }}/build" \
76+ cmake -S "${{ github.workspace }}" \
77+ -B "${{ github.workspace }}/build" \
7278 -G Ninja \
7379 -DCMAKE_BUILD_TYPE=Release \
7480 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
@@ -80,39 +86,35 @@ jobs:
8086 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install-test"
8187
8288 - name : Build
83- working-directory : ${{ github.workspace }}/build
84- run : cmake --build . --parallel $(nproc)
89+ run : cmake --build "${{ github.workspace }}/build" --parallel $(nproc)
8590
86- - name : Install (to test install rules)
87- working-directory : ${{ github.workspace }}/build
88- run : cmake --install .
91+ - name : Install (test install rules)
92+ run : cmake --install "${{ github.workspace }}/build"
8993
9094 - name : Show installed files (debug)
9195 if : always()
9296 run : |
93- echo "Installed files: "
94- find "${{ github.workspace }}/install-test" -type f | sort || echo "No files installed"
97+ echo "=== Installed files === "
98+ find "${{ github.workspace }}/install-test" -type f | sort || echo "Nothing installed"
9599
96- - name : Smoke check - catmsg executable exists and runs
100+ - name : Smoke check - catmsg executable
97101 if : runner.os == 'Linux'
98- working-directory : ${{ github.workspace }}/build/apps/catmsg
99102 run : |
100- if [ ! -f ./catmsg ]; then
101- echo "ERROR: catmsg executable was not built!"
103+ set -e
104+ EXEC="${{ github.workspace }}/build/apps/catmsg/catmsg"
105+ if [ ! -x "$EXEC" ]; then
106+ echo "ERROR: catmsg not built or not executable"
102107 exit 1
103108 fi
104109
105- echo "Running: ./catmsg --help"
106- ./catmsg --help || true
107-
108- echo "Checking for expected output pattern..."
109- ./catmsg 2>&1 | grep -qi "usage\|catmsg" && echo "OK - found usage/help message" || {
110- echo "ERROR: Did not find expected usage/help message"
110+ echo "Running: $EXEC (expect usage/help)"
111+ "$EXEC" 2>&1 | grep -qiE "usage|catmsg|options" && echo "OK - found expected output" || {
112+ echo "ERROR: No expected usage/help message"
113+ "$EXEC" --help || true
111114 exit 1
112115 }
113116
114- # Uncomment when you add unit tests
115- # - name: Run tests
117+ # Uncomment when tests are ready
118+ # - name: Run unit tests
116119 # if: runner.os == 'Linux'
117- # working-directory: ${{ github.workspace }}/build
118- # run: ctest --output-on-failure --parallel $(nproc)
120+ # run: ctest --test-dir "${{ github.workspace }}/build" --output-on-failure --parallel $(nproc)
0 commit comments