Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac build workflow #8

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: MacOS build

on:
push:
pull_request:
branches:
- main

jobs:

macos_build:
runs-on: macos-13
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:

- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge
auto-update-conda: true
miniconda-version: latest

- name: Cache
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/.ccache
key: ${{ runner.os }}-cache-mac-${{ github.run_id }}
restore-keys: ${{ runner.os }}-cache-mac-

- name: Install Requirements
shell: bash -l {0}
run: |
source .github/workflows/mac/before_install.sh

- name: Build
shell: bash -l {0}
run: |
source .github/workflows/mac/install.sh
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
TRAVIS_OS_NAME: osx
BUILD_NAME: osx

- name: Run Tests
run: |
cd build
ctest --output-on-failure --no-compress-output -T Test
11 changes: 11 additions & 0 deletions .github/workflows/mac/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

conda update -n base -c defaults conda
conda install compilers -y

conda config --set channel_priority strict

conda install --yes --quiet libtool ccache ninja qt qt-webengine qtkeychain -y

40 changes: 40 additions & 0 deletions .github/workflows/mac/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -e

export CCACHE_CPP2=yes

ccache -M 200M
ccache -s

export CC="ccache clang"
export CXX="ccache clang++"
export CFLAGS="-Werror -O2"
export CXXFLAGS="-Werror -O2"

mkdir -p build
cd build
cmake -GNinja \
-Do2_BUILD_EXAMPLES:BOOL=ON \
-Do2_WITH_TESTS=ON \
-Do2_SHOW_TRACE:BOOL=ON \
-Do2_WITH_DROPBOX:BOOL=ON \
-Do2_WITH_FACEBOOK:BOOL=ON \
-Do2_WITH_FLICKR:BOOL=ON \
-Do2_WITH_GOOGLE:BOOL=ON \
-Do2_WITH_HUBIC:BOOL=ON \
-Do2_WITH_KEYCHAIN:BOOL=ON \
-Do2_WITH_MSGRAPH:BOOL=ON \
-Do2_WITH_OAUTH1:BOOL=ON \
-Do2_WITH_QT5:BOOL=ON \
-Do2_WITH_SKYDRIVE:BOOL=ON \
-Do2_WITH_SMUGMUG:BOOL=ON \
-Do2_WITH_SPOTIFY:BOOL=ON \
-Do2_WITH_SURVEYMONKEY:BOOL=ON \
-Do2_WITH_TWITTER:BOOL=ON \
-Do2_WITH_UBER:BOOL=ON \
-Do2_WITH_VIMEO:BOOL=ON \
..
ninja

ccache -s
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ if (o2_WITH_OAUTH1)
set(HAVE_OAUTH1_SUPPORT 1)
endif()

if(o2_WITH_KEYCHAIN)
if(o2_WITH_QT5)
find_package(Qt5Keychain CONFIG REQUIRED)
else()
find_package(Qt6Keychain CONFIG REQUIRED)
endif()

message("Found QTKeychain")

endif(o2_WITH_KEYCHAIN)

if(o2_WITH_TWITTER OR o2_WITH_DROPBOX OR o2_WITH_FLICKR OR o2_WITH_SMUGMUG)
set(o2_WITH_OAUTH1 ON)
Expand Down
38 changes: 0 additions & 38 deletions cmake/modules/FindQt5Keychain.cmake

This file was deleted.

39 changes: 0 additions & 39 deletions cmake/modules/FindQtKeychain.cmake

This file was deleted.

34 changes: 10 additions & 24 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,33 +192,19 @@ if(o2_WITH_MSGRAPH)
endif(o2_WITH_MSGRAPH)

if(o2_WITH_KEYCHAIN)
if (Qt5Core_DIR)
find_package(Qt5Keychain REQUIRED)
else()
find_package(QtKeychain REQUIRED)
endif()
if(QTKEYCHAIN_FOUND OR QT5KEYCHAIN_FOUND)
MESSAGE("Found QTKeychain")
list(APPEND LINK_TARGETS ${QTKEYCHAIN_LIBRARY})
include_directories(${QTKEYCHAIN_INCLUDE_DIR})
set( o2_SRCS
${o2_SRCS}
o0keychainstore.cpp
)
set( o2_HDRS
${o2_HDRS}
o0keychainstore.h
)
else()
MESSAGE("Qt5Keychain or QtKeychain is required")
endif()

list(APPEND LINK_TARGETS ${QTKEYCHAIN_LIBRARIES})
include_directories(SYSTEM ${QTKEYCHAIN_INCLUDE_DIRS})
set( o2_SRCS
${o2_SRCS}
o0keychainstore.cpp
)
set( o2_HDRS
${o2_HDRS}
o0keychainstore.h
)

endif(o2_WITH_KEYCHAIN)




if(NOT o2_WITH_QT5)
add_definitions(${QT4_DEFINITIONS})
endif(NOT o2_WITH_QT5)
Expand Down
2 changes: 1 addition & 1 deletion tests/teststore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private slots:
QString testKey = "testKey";
QString testValue = "testValue";
store->setValue(testKey, testValue);
QCOMPARE(store->value(testKey), testValue);
QCOMPARE(store->value(testKey), "testValuexx");
}

void testGroupKey() {
Expand Down
Loading