From 4620a12c828bfc2d61cb1ab77d975ebeac91cee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Wed, 20 Sep 2023 13:05:31 +0200 Subject: [PATCH] Add Github Actions Add a Github action file to test builds on macOS, Windows and Ubuntu --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++++++++ .reuse/dep5 | 2 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..6630897da --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: Build tests +on: + - push +env: + COMMON_ARGS: +jobs: + build-windows: + strategy: + matrix: + configuration: + - Debug + - Release + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + - uses: ilammy/msvc-dev-cmd@v1 + with: + vsversion: 2019 + - name: Configure project + run: | + mkdir build + cmake -B build --warn-uninitialized -Werror=dev -G Ninja -DLIBICAL_DEVMODE_MEMORY_CONSISTENCY=True -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DLIBICAL_BUILD_TESTING=True -DENABLE_GTK_DOC=False -DICAL_GLIB=False -DGOBJECT_INTROSPECTION=False -DICAL_GLIB_VAPI=False + shell: cmd + - name: Build project + run: cmake --build build + shell: cmd + - name: Test project + run: cd build && ctest --test-dir . + shell: cmd + + build-ubuntu: + strategy: + matrix: + configuration: + - Debug + - Release + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: sudo apt-get -y install gtk-doc-tools xml-core libdb-dev gobject-introspection libgirepository1.0-dev valac cmake ninja-build + - name: Configure project + run: | + mkdir build + cmake -B build --warn-uninitialized -Werror=dev -G Ninja -DLIBICAL_DEVMODE_MEMORY_CONSISTENCY=False -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DLIBICAL_BUILD_TESTING=True -DENABLE_GTK_DOC=True -DICAL_GLIB=True -DGOBJECT_INTROSPECTION=True -DICAL_GLIB_VAPI=True + - name: Build project + run: cmake --build build + - name: Test project + run: cd build && ctest --test-dir . + + build-macos: + strategy: + matrix: + configuration: + - Debug + - Release + runs-on: macos-12 + env: + XML_CATALOG_FILES: /usr/local/etc/xml/catalog + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: brew install pkg-config ninja gtk-doc glib libxml2 icu4c berkeley-db docbook docbook-xsl + - name: Configure project + run: | + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig + export XML_CATALOG_FILES=/usr/local/etc/xml/catalog + mkdir build + cmake -B build --warn-uninitialized -Werror=dev -G Ninja -DLIBICAL_DEVMODE_MEMORY_CONSISTENCY=True -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DLIBICAL_BUILD_TESTING=True -DENABLE_GTK_DOC=True -DICAL_GLIB=True -DGOBJECT_INTROSPECTION=False -DICAL_GLIB_VAPI=False + - name: Build project + run: cmake --build build + - name: Test project + run: cd build && ctest --test-dir . diff --git a/.reuse/dep5 b/.reuse/dep5 index bfa19252e..666965002 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -9,7 +9,7 @@ Copyright: Copyright Contributors to the libical project License: LGPL-2.1-only OR MPL-2.0 #tool configuration files -Files: .clang-tidy .cmake-format.py .codespellrc .dir-locals.el .gitignore .krazy .mdlrc .mdlrc.rb .pre-commit-config.yaml .pylintrc .pep8 .travis.yml appveyor.yml +Files: .clang-tidy .cmake-format.py .codespellrc .dir-locals.el .gitignore .krazy .mdlrc .mdlrc.rb .pre-commit-config.yaml .pylintrc .pep8 .travis.yml appveyor.yml .github/workflows/build.yml Copyright: Copyright Contributors to the libical project License: BSD-3-Clause