diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000..c02fb62 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,51 @@ +name: Build and Test + +on: + - pull_request + - push + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure + run: CFLAGS='--coverage -g -O0' cmake -DCMAKE_BUILD_TYPE=Debug -G 'Unix Makefiles' . + - name: Build + run: make VERBOSE=1 + - name: Test + run: for testsuite in test-*; do echo "Running $testsuite:"; ./$testsuite; done + - name: Code Coverage Report + if: ${{ github.event_name == 'push' }} + continue-on-error: true + run: | + sudo apt-get install -y lcov + lcov --directory . --capture --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info + lcov --remove coverage.info 'tests/*' --output-file coverage.info + lcov --list coverage.info + bash <(curl -s https://codecov.io/bash) + + windows-32: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v1.3.1 + - name: Configure + run: cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A Win32 . + - name: Build + run: msbuild.exe hsluv-c.sln /p:Configuration=Debug /p:Platform=Win32 + - name: Test + run: for %t in ("tests\Debug\test-*.exe") do %t + + windows-64: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: microsoft/setup-msbuild@v1.3.1 + - name: Configure + run: cmake -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 17 2022" -A x64 . + - name: Build + run: msbuild.exe hsluv-c.sln /p:Configuration=Debug /p:Platform=x64 + - name: Test + run: for %t in ("tests\Debug\test-*.exe") do %t diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2bff8c0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -# YAML definition for travis-ci.com continuous integration. -# See https://docs.travis-ci.com/user/languages/c - -language: c - -compiler: - - gcc - -addons: - apt: - packages: - - lcov # for generating code coverage report - -before_script: - - mkdir build - - cd build - - CFLAGS='--coverage -g -O0' cmake -DCMAKE_BUILD_TYPE=Debug -G 'Unix Makefiles' .. - -script: - - make VERBOSE=1 - -after_success: - # Run tests - - for testsuite in test-*; do echo "Running $testsuite:"; ./$testsuite; done - # Create coverage data - - lcov --directory . --capture --output-file coverage.info # capture coverage info - - lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - - lcov --remove coverage.info 'tests/*' --output-file coverage.info # filter out unit test suites - - lcov --list coverage.info # debug info - # Upload coverage data to CodeCov - - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f5682dd..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -# YAML definition for Appveyor.com continuous integration. -# See http://www.appveyor.com/docs/appveyor-yml - -version: '{branch}-{build}' - -before_build: - - 'cmake --version' - - 'if "%PLATFORM%"=="x64" cmake -G "Visual Studio 12 Win64" .' - - 'if not "%PLATFORM%"=="x64" cmake -G "Visual Studio 12" .' - -build: - project: c-reusables.sln - verbosity: minimal - -skip_tags: true - -os: - - Windows Server 2012 R2 - -configuration: - - Debug - - Release - -platform: - - x64 # 64-bit build - - win32 # 32-bit build - -artifacts: - - path: '**\test-*.exe'