Try -U_ISOC23_SOURCE to disable C23 function redirects #238
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master, develop, add-sensor-plot, add-rdata-output ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| jobs: | |
| test-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Add WildlifeSystems apt repository | |
| run: | | |
| sudo wget -O /usr/share/keyrings/ws.gpg https://wildlife.systems/ws.gpg | |
| echo -e "Types: deb\nURIs: https://apt.wildlife.systems\nSuites: stable\nComponents: main\nArchitectures: all amd64\nSigned-By: /usr/share/keyrings/ws.gpg" | sudo tee /etc/apt/sources.list.d/ws.sources > /dev/null | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential g++ libncurses-dev zlib1g-dev sensor-control | |
| - name: Build with coverage | |
| run: make clean all COVERAGE=1 | |
| - name: Run unit tests | |
| run: make test COVERAGE=1 | |
| - name: Run integration tests | |
| run: make test-integration | |
| - name: Generate coverage report | |
| run: make coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| test-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: brew install lcov coreutils ncurses | |
| - name: Build with coverage | |
| run: make clean all COVERAGE=1 | |
| - name: Run unit tests | |
| run: make test COVERAGE=1 | |
| - name: Run integration tests | |
| run: make test-integration | |
| - name: Generate coverage report | |
| run: make coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: mingw-w64-x86_64-gcc make mingw-w64-x86_64-lcov mingw-w64-x86_64-pdcurses mingw-w64-x86_64-zlib | |
| - name: Build with coverage | |
| shell: msys2 {0} | |
| run: make clean all COVERAGE=1 | |
| - name: Run unit tests | |
| shell: msys2 {0} | |
| run: make test COVERAGE=1 | |
| - name: Run integration tests | |
| shell: msys2 {0} | |
| run: make test-integration | |
| - name: Generate coverage report | |
| shell: msys2 {0} | |
| run: make coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| test-rdata: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential g++ libncurses-dev zlib1g-dev r-base | |
| - name: Build sensor-data binary | |
| run: make clean sensor-data COVERAGE=1 | |
| - name: Test RData output | |
| run: | | |
| # Create test JSON input | |
| echo '{"sensor_id":"temp1","unit":"C","value":23.5}' > /tmp/test_input.json | |
| # Transform to RData | |
| ./sensor-data transform -of rdata -o /tmp/test_output.RData /tmp/test_input.json | |
| # Validate with R - load and verify structure | |
| Rscript -e " | |
| load('/tmp/test_output.RData') | |
| stopifnot(exists('sensor_data')) | |
| stopifnot(is.data.frame(sensor_data)) | |
| stopifnot(nrow(sensor_data) == 1) | |
| print(sensor_data) | |
| cat('RData validation passed!\n') | |
| " | |
| - name: Test RDS output | |
| run: | | |
| # Create test JSON input | |
| echo '{"sensor":"ds18b20","sensor_id":"28-123","value":21.5}' > /tmp/test_rds.json | |
| # Transform to RDS | |
| ./sensor-data transform -of rds -o /tmp/test_output.rds /tmp/test_rds.json | |
| # Validate with R - load and verify structure | |
| Rscript -e " | |
| sensor_data <- readRDS('/tmp/test_output.rds') | |
| stopifnot(is.data.frame(sensor_data)) | |
| stopifnot(nrow(sensor_data) == 1) | |
| print(sensor_data) | |
| cat('RDS validation passed!\n') | |
| " | |
| - name: Generate coverage report | |
| run: make coverage | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| verbose: true | |
| build-deb: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential debhelper devscripts fakeroot lintian libncurses-dev | |
| - name: Build Debian package | |
| run: | | |
| dpkg-buildpackage -us -uc -b | |
| mkdir -p debian-output | |
| cp ../sensor-tools_*.deb debian-output/ | |
| - name: Run lintian checks | |
| run: | | |
| lintian --info --display-info debian-output/*.deb || true | |
| - name: Upload .deb artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: debian-package | |
| path: debian-output/*.deb | |
| retention-days: 14 |