diff options
-rw-r--r-- | .github/workflows/mac.yml | 35 | ||||
-rw-r--r-- | .github/workflows/sw.yml (renamed from .github/workflows/linux.yml) | 10 | ||||
-rw-r--r-- | .github/workflows/windows.yml | 35 | ||||
-rw-r--r-- | sw.cpp | 34 | ||||
-rw-r--r-- | test/main.cpp | 2 |
5 files changed, 33 insertions, 83 deletions
diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml deleted file mode 100644 index 4d75508..0000000 --- a/.github/workflows/mac.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: mac - -on: [push] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [macOS-latest] - - steps: - - uses: actions/checkout@v1 - #- uses: egorpugin/sw-action@master - - - name: Download SW - shell: cmake -P {0} - run: | - if (WIN32) - file(DOWNLOAD "https://software-network.org/client/sw-master-windows-client.zip" ./sw.zip) - elseif (APPLE) - file(DOWNLOAD "https://software-network.org/client/sw-master-macos-client.tar.gz" ./sw.zip) - else() - file(DOWNLOAD "https://software-network.org/client/sw-master-linux-client.tar.gz" ./sw.zip) - endif() - - - name: Unpack SW - run: cmake -E tar xvf sw.zip - - - name: chmod - run: chmod 755 sw - shell: sh - - - name: build - run: ./sw build diff --git a/.github/workflows/linux.yml b/.github/workflows/sw.yml index b0ef994..a58f77c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/sw.yml @@ -1,13 +1,14 @@ -name: linux +name: sw -on: [push] +on: [push, pull-request] jobs: build: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: - os: [ubuntu-latest] + os: [windows-latest, ubuntu-latest, macOS-latest] steps: - uses: actions/checkout@v1 @@ -33,3 +34,6 @@ jobs: - name: build run: ./sw build + + - name: test + run: ./sw test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 1f8c89f..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: windows - -on: [push] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - - steps: - - uses: actions/checkout@v1 - #- uses: egorpugin/sw-action@master - - - name: Download SW - shell: cmake -P {0} - run: | - if (WIN32) - file(DOWNLOAD "https://software-network.org/client/sw-master-windows-client.zip" ./sw.zip) - elseif (APPLE) - file(DOWNLOAD "https://software-network.org/client/sw-master-macos-client.tar.gz" ./sw.zip) - else() - file(DOWNLOAD "https://software-network.org/client/sw-master-linux-client.tar.gz" ./sw.zip) - endif() - - - name: Unpack SW - run: cmake -E tar xvf sw.zip - - - name: chmod - run: chmod 755 sw - shell: sh - - - name: build - run: ./sw build @@ -1,14 +1,28 @@ void build(Solution &s) { auto &tgbot = s.addTarget<StaticLibraryTarget>("reo7sp.tgbot", "1.2.0"); - tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}"); - - tgbot += cpp11; - - tgbot.Public += "org.sw.demo.boost.property_tree"_dep; - tgbot.Public += "org.sw.demo.openssl.ssl"_dep; - tgbot.Public += "org.sw.demo.boost.system"_dep; - tgbot.Public += "org.sw.demo.boost.date_time"_dep; - tgbot.Public += "org.sw.demo.badger.curl.libcurl"_dep, "HAVE_CURL"_def; - tgbot.Public += "org.sw.demo.boost.asio"_dep; + { + tgbot += Git("https://github.com/reo7sp/tgbot-cpp", "v{M}.{m}"); + + tgbot += cpp11; + + tgbot.Public += "org.sw.demo.boost.property_tree"_dep; + tgbot.Public += "org.sw.demo.openssl.ssl"_dep; + tgbot.Public += "org.sw.demo.boost.system"_dep; + tgbot.Public += "org.sw.demo.boost.date_time"_dep; + tgbot.Public += "org.sw.demo.badger.curl.libcurl"_dep, "HAVE_CURL"_def; + tgbot.Public += "org.sw.demo.boost.asio"_dep; + } + + auto &t = tgbot.addExecutable("test"); + { + t.Scope = TargetScope::Test; + t += "test/.*"_rr; + t += "test"_idir; + t += "SW_BUILD"_def; + t += tgbot; + t += "org.sw.demo.boost.test"_dep; + } + + tgbot.addTest(t); } diff --git a/test/main.cpp b/test/main.cpp index c89e782..d9b0da0 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -1,4 +1,6 @@ +#ifndef SW_BUILD #define BOOST_TEST_DYN_LINK +#endif #define BOOST_TEST_MODULE TgBot #include <boost/test/unit_test.hpp> |