From 124b396f5af298fa87f59f9aedf74977c21029ca Mon Sep 17 00:00:00 2001 From: Alexande B Date: Fri, 12 Nov 2021 18:17:57 +0100 Subject: [PATCH] #1648 building dependencies with vcpkg (skip ci) --- .github/workflows/ubuntu.yml | 44 +++++++++++++++--------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5271e04b63..eb1e00667e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -22,11 +22,14 @@ env: BUILD_MODE: normal GPG_VERSION: stable USE_STATIC_DEPENDENCIES: yes + VCPKG_ROOT: '/usr/local/share/vcpkg' jobs: tests: name: ${{ matrix.os }} [CC ${{ matrix.env.CC }}; GnuPG stable] runs-on: ${{ matrix.os }} + # if: "!contains(github.event.head_commit.message, 'skip ci')" + timeout-minutes: 50 strategy: fail-fast: false matrix: @@ -36,37 +39,26 @@ jobs: CXX: g++ - CC: clang CXX: clang++ - if: "!contains(github.event.head_commit.message, 'skip ci')" - env: ${{ matrix.env }} - timeout-minutes: 50 + triplet: [x64-linux] steps: - uses: actions/checkout@v2 with: fetch-depth: 1 - - name: Setup environment - run: | - . ci/gha/setup-env.inc.sh - ci/install_noncacheable_dependencies.sh - - name: Cache - id: cache - uses: actions/cache@v2 + + - uses: actions/cache@v2 with: - path: ${{ env.CACHE_DIR }} - key: ${{ github.workflow }}-${{ runner.os }}-${{ env.BUILD_MODE }}-${{ matrix.env.CC }}-gpg-${{ env.GPG_VERSION }}-${{ hashFiles('ci/**') }}-${{ hashFiles('.github/workflows/**') }} - - name: Build cache - if: steps.cache.outputs.cache-hit != 'true' - run: | - set -x - ci/install_cacheable_dependencies.sh - - name: tests - run: | - set -x - ci/run.sh - - name: Package - run: | - set -x - cd ${LOCAL_BUILDS}/rnp-build - cpack -G DEB -D CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS="${BOTAN_INSTALL}/lib;${JSONC_INSTALL}/lib;${GPG_INSTALL}/lib" + path: ${{ env.VCPKG_ROOT }} + key: vcpkg-ubuntu-${{ hashFiles('vcpkg.txt') }} + + - run: vcpkg install --vcpkg-root=${{ env.VCPKG_DIR }} --triplet ${{ matrix.triplet }} $(cat vcpkg.txt) + + - run: cmake -B ./build --config "Release" -A ${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DIR }}/scripts/buildsystems/vcpkg.cmake . + + - run: cmake --build ./build --config "Release" -j 2 + + - run: cmake --install ./build --config "Release" -j 2 + + - run: cpack -B ./build -G DEB cmake-offline-googletest-src: env: GTEST_SOURCES: /usr/src/googletest