diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 528921e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,33 +0,0 @@ -version: 2 -jobs: - test_debug: - docker: - - image: tschijnmo/drudge:corebase - steps: - - run: | - git clone --recurse-submodules https://github.com/tschijnmo/libcanon.git - mkdir cmake-test-debug - cd cmake-test-debug - cmake -DCMAKE_BUILD_TYPE=debug ../libcanon - make - ctest - - test_release: - docker: - - image: tschijnmo/drudge:corebase - steps: - - run: | - git clone --recurse-submodules https://github.com/tschijnmo/libcanon.git - mkdir cmake-test-release - cd cmake-test-release - cmake -DCMAKE_BUILD_TYPE=release ../libcanon - make - ctest - -workflows: - version: 2 - tests: - jobs: - - test_debug - - test_release - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9127143 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: CI + +on: + push: + branches: + - master + - 'release/*' + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + test_debug: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake g++ + + - name: Configure CMake (Debug) + run: | + mkdir -p build-debug + cd build-debug + cmake -DCMAKE_BUILD_TYPE=debug .. + + - name: Build (Debug) + run: | + cd build-debug + make + + - name: Run tests (Debug) + run: | + cd build-debug + ctest --output-on-failure + + test_release: + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake g++ + + - name: Configure CMake (Release) + run: | + mkdir -p build-release + cd build-release + cmake -DCMAKE_BUILD_TYPE=release .. + + - name: Build (Release) + run: | + cd build-release + make + + - name: Run tests (Release) + run: | + cd build-release + ctest --output-on-failure diff --git a/.gitignore b/.gitignore index 2242dee..3c6e104 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,8 @@ # For Clion .idea/workspace.xml + +# Build directories +build/ +build-*/ +cmake-build-*/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c6c374f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -sudo: required - -language: - - cpp - -services: - - docker - -install: - - docker build -t tschijnmo/libcanon_test . - -script: - - > - docker run --rm tschijnmo/libcanon_test /bin/sh -c - "mkdir _build; - cd _build; - cmake ..; - make; - ctest; - " - diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py deleted file mode 100644 index e34f0a9..0000000 --- a/.ycm_extra_conf.py +++ /dev/null @@ -1,17 +0,0 @@ -import os - -def FlagsForFile(filename, **kwargs): - - flags = ['-std=c++14', '-I/usr/local/include'] - - proj_root = os.path.dirname(os.path.abspath(__file__)) - proj_include = ''.join(['-I', proj_root, '/include']) - flags.append(proj_include) - - if filename.endswith('_test.cpp'): - gtest_include = ''.join([ - '-I', proj_root, '/test/googletest/googletest/include' - ]) - flags.append(gtest_include) - - return {'flags': flags} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index bbd9002..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -# Dockerfile for a test environment for libcanon. - -FROM gcc:latest - -RUN apt-get update && apt-get install -y --no-install-recommends cmake - -WORKDIR /libcanon/ -ADD . . - diff --git a/README.md b/README.md index 2861ef5..7e3d0c3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://circleci.com/gh/tschijnmo/libcanon.svg?style=shield)](https://circleci.com/gh/tschijnmo/libcanon) +[![CI](https://github.com/DrudgeCAS/libcanon/actions/workflows/ci.yml/badge.svg)](https://github.com/DrudgeCAS/libcanon/actions/workflows/ci.yml) # libcanon