From 7cfb4bc9ffbee05486cfafd7111237fdd113d3cc Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sun, 24 Mar 2024 16:15:05 +0000 Subject: [PATCH] Migrate CI to GitHub Actions --- .gitattributes | 1 + .github/workflows/main.yml | 50 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 33 ------------------------- appveyor.yml | 42 -------------------------------- 4 files changed, 51 insertions(+), 75 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ad87eca --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + build_type: + - Debug + - Release + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: recursive + + - name: Setup MSVC + if: runner.os == 'Windows' + uses: TheMrMilchmann/setup-msvc-dev@v3 + with: + arch: x64 + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + version: 5.15.* + + - name: Build + shell: bash + run: | + if [ "$RUNNER_OS" == "Windows" ]; then + export CMAKE_GENERATOR=Ninja + fi + cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=install -DLIBBNDL_BUILD_UI=ON + cmake --build build + cmake --install build + + - uses: actions/upload-artifact@v4 + with: + name: libbndl-${{ matrix.build_type }}-${{ matrix.os }} + path: install/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a977931..0000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -# Cpp language -language: cpp -dist: bionic - -# Compiler selection -compiler: - - clang - - gcc - -# Apt packages -addons: - apt: - sources: - - sourceline: "ppa:beineri/opt-qt-5.12.3-bionic" - packages: - - g++-8 - - gcc-8 - - libgl1-mesa-dev - - qt512base - - qt512multimedia - -# Install -install: - - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CXX" = "g++" ]; then export CXX="g++-8" CC="gcc-8"; fi - - source /opt/qt512/bin/qt512-env.sh # Needed with Beineri PPA - -# Build steps -script: - - mkdir build - - cd build - - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install - - make -j2 - - make install diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c5180a1..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: '0.0.0.{build}' - -image: Visual Studio 2019 - -environment: - matrix: - - ARCHITECTURE: "x86" - QT5_DIR: C:\Qt\5.12\msvc2017 - - ARCHITECTURE: "x64" - QT5_DIR: C:\Qt\5.12\msvc2017_64 - -matrix: - fast_finish: true - -install: -- call "%QT5_DIR%\bin\qtenv2.bat" -- call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat" %ARCHITECTURE% -- cd /D "%APPVEYOR_BUILD_FOLDER%" -- git submodule update --init --recursive - -before_build: -- cmake -H. -Bbuild-debug -G Ninja -DCMAKE_PREFIX_PATH="%QT5_DIR%" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=install-debug -DCMAKE_MAKE_PROGRAM="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja\\ninja.exe" -- cmake -H. -Bbuild-release -G Ninja -DCMAKE_PREFIX_PATH="%QT5_DIR%" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install-release -DCMAKE_MAKE_PROGRAM="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\Ninja\\ninja.exe" - - -build_script: -- cmake --build build-debug --target install -- cmake --build build-release --target install - -after_build: -- cd install-debug -- 7z a libbndl-%ARCHITECTURE%-debug.zip .\* -- cd ..\install-release -- 7z a libbndl-%ARCHITECTURE%-release.zip .\* - -test: off - -artifacts: -- path: install-release\libbndl-%ARCHITECTURE%-release.zip - name: libbndl-%ARCHITECTURE%-release.zip -- path: install-debug\libbndl-%ARCHITECTURE%-debug.zip - name: libbndl-%ARCHITECTURE%-debug.zip