From 08de0609df2649170ecdc927c312e08387e6cc67 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 09:14:14 +0100 Subject: CI: no need to explicitly build quotest Now that CTest is included, quotest target should build (and install) automatically together with the library. --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d121e432..7077ff35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,15 +100,10 @@ jobs: - name: Build and install libQuotient run: cmake --build build --target install - - name: Build tests - run: | - cmake -S quotest -Bbuild-quotest $CMAKE_ARGS - cmake --build build-quotest --target all - - name: Run tests env: TEST_USER: ${{ secrets.TEST_USER }} TEST_PWD: ${{ secrets.TEST_PWD }} run: | - [[ -z "$TEST_USER" ]] || $VALGRIND build-quotest/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" + [[ -z "$TEST_USER" ]] || $VALGRIND build/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" timeout-minutes: 5 # quotest is supposed to finish within 3 minutes, actually -- cgit v1.2.3 From e23cddccf0dbafdb5e8d3503d6f6b7491f5b9010 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 14:02:45 +0100 Subject: CI: include github.ref in the quotest origin --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7077ff35..5def16ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: echo "CC=clang" >>$GITHUB_ENV echo "CXX=clang++" >>$GITHUB_ENV fi - echo "QUOTEST_ORIGIN=${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV + echo "QUOTEST_ORIGIN=${{ github.ref }} @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV echo "DESTDIR=${{ runner.workspace }}" >>$GITHUB_ENV echo "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=${{ runner.workspace }}/usr" >>$GITHUB_ENV cmake -E make_directory ${{ runner.workspace }}/build -- cgit v1.2.3 From 579fc2504be9e5e0291e44da685f10a21a4c64a5 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 11:07:45 +0100 Subject: CI: install to ~/.local; invoke quotest from there That way InstallQuotest feature is also tested. Also fix the Valgrind suppression file path. Also: use cmake arguments instead of pushd/popd dance --- .github/workflows/ci.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5def16ee..52580dd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: if: contains(matrix.os, 'ubuntu') run: | sudo apt-get install valgrind - echo "VALGRIND=valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=tests/.valgrind.supp" >>$GITHUB_ENV + echo "VALGRIND=valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=quotest/.valgrind.supp" >>$GITHUB_ENV - name: Setup build environment run: | @@ -62,8 +62,8 @@ jobs: echo "CXX=clang++" >>$GITHUB_ENV fi echo "QUOTEST_ORIGIN=${{ github.ref }} @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV - echo "DESTDIR=${{ runner.workspace }}" >>$GITHUB_ENV - echo "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=${{ runner.workspace }}/usr" >>$GITHUB_ENV + echo "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_PREFIX_PATH=~/.local" >>$GITHUB_ENV cmake -E make_directory ${{ runner.workspace }}/build - name: Build and install olm @@ -71,10 +71,11 @@ jobs: run: | cd ${{ runner.workspace }} git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm - cmake . -B build $CMAKE_ARGS - cmake --build build --target install - popd + cmake -S olm -B olm/build $CMAKE_ARGS + cmake --build olm/build --target install + OLM_SO_PATH=$(dirname $(find ~/.local/lib* -name libolm.so)) + test -n "$OLM_SO_PATH" + echo "DEP_SO_PATH=$OLM_SO_PATH" >>$GITHUB_ENV echo "QUOTEST_ORIGIN=$QUOTEST_ORIGIN with E2EE" >>$GITHUB_ENV - name: Pull CS API and build GTAD @@ -83,10 +84,8 @@ jobs: cd ${{ runner.workspace }} git clone https://github.com/matrix-org/matrix-doc.git git clone --recursive https://github.com/KitsuneRal/gtad.git - pushd gtad - cmake . $CMAKE_ARGS - cmake --build . - popd + cmake -S gtad -B gtad $CMAKE_ARGS + cmake --build gtad echo "CMAKE_ARGS=$CMAKE_ARGS -DMATRIX_DOC_PATH=${{ runner.workspace }}/matrix-doc -DGTAD_PATH=${{ runner.workspace }}/gtad/gtad" >>$GITHUB_ENV echo "QUOTEST_ORIGIN=$QUOTEST_ORIGIN and API files regeneration" >>$GITHUB_ENV @@ -98,12 +97,15 @@ jobs: run: cmake --build build --target update-api - name: Build and install libQuotient - run: cmake --build build --target install + run: | + cmake --build build --target install + ls ~/.local/bin/quotest - name: Run tests env: TEST_USER: ${{ secrets.TEST_USER }} TEST_PWD: ${{ secrets.TEST_PWD }} + LD_LIBRARY_PATH: "${{ env.DEP_SO_PATH }}:${{ env.Qt5_DIR }}/lib" run: | - [[ -z "$TEST_USER" ]] || $VALGRIND build/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" + [[ -z "$TEST_USER" ]] || $VALGRIND ~/.local/bin/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" timeout-minutes: 5 # quotest is supposed to finish within 3 minutes, actually -- cgit v1.2.3 From d4005a2ee5fbd51ae169b8827421f448a4cf8050 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 16:19:50 +0100 Subject: Use Ninja --- .github/workflows/ci.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52580dd9..bebeff8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,24 +45,28 @@ jobs: version: '5.9.9' cached: ${{ steps.cache-qt.outputs.cache-hit }} - - name: Install Valgrind - if: contains(matrix.os, 'ubuntu') + - name: Install Ninja (macOS) + if: ${{ !startsWith(matrix.os, 'ubuntu') }} + uses: seanmiddleditch/gha-setup-ninja@v3 + + - name: Install Ninja and Valgrind (Linux) + if: startsWith(matrix.os, 'ubuntu') run: | - sudo apt-get install valgrind + sudo apt-get -qq install ninja-build valgrind echo "VALGRIND=valgrind --tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=quotest/.valgrind.supp" >>$GITHUB_ENV - name: Setup build environment run: | if [ "${{ matrix.compiler }}" == "GCC" ]; then - if [ -n "${{ matrix.update-api }}" ]; then VERSION_POSTFIX='-8'; fi - echo "CC=gcc$VERSION_POSTFIX" >>$GITHUB_ENV - echo "CXX=g++$VERSION_POSTFIX" >>$GITHUB_ENV + if [ -n "${{ matrix.update-api }}" ]; then VERSION_POSTFIX='-8'; fi + echo "CC=gcc$VERSION_POSTFIX" >>$GITHUB_ENV + echo "CXX=g++$VERSION_POSTFIX" >>$GITHUB_ENV else - echo "CC=clang" >>$GITHUB_ENV - echo "CXX=clang++" >>$GITHUB_ENV + echo "CC=clang" >>$GITHUB_ENV + echo "CXX=clang++" >>$GITHUB_ENV fi echo "QUOTEST_ORIGIN=${{ github.ref }} @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV - echo "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo \ + echo "CMAKE_ARGS=-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_PREFIX_PATH=~/.local" >>$GITHUB_ENV cmake -E make_directory ${{ runner.workspace }}/build -- cgit v1.2.3 From 37fde3d877b162e8867416bd1d70ee0808976620 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 17:05:06 +0100 Subject: CI: build libraries statically Shared libraries are a bit of a chore to handle, maybe another time. --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bebeff8a..b69d34e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: echo "CXX=clang++" >>$GITHUB_ENV fi echo "QUOTEST_ORIGIN=${{ github.ref }} @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV - echo "CMAKE_ARGS=-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + echo "CMAKE_ARGS=-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=false \ -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_PREFIX_PATH=~/.local" >>$GITHUB_ENV cmake -E make_directory ${{ runner.workspace }}/build @@ -77,9 +77,6 @@ jobs: git clone https://gitlab.matrix.org/matrix-org/olm.git cmake -S olm -B olm/build $CMAKE_ARGS cmake --build olm/build --target install - OLM_SO_PATH=$(dirname $(find ~/.local/lib* -name libolm.so)) - test -n "$OLM_SO_PATH" - echo "DEP_SO_PATH=$OLM_SO_PATH" >>$GITHUB_ENV echo "QUOTEST_ORIGIN=$QUOTEST_ORIGIN with E2EE" >>$GITHUB_ENV - name: Pull CS API and build GTAD @@ -90,7 +87,9 @@ jobs: git clone --recursive https://github.com/KitsuneRal/gtad.git cmake -S gtad -B gtad $CMAKE_ARGS cmake --build gtad - echo "CMAKE_ARGS=$CMAKE_ARGS -DMATRIX_DOC_PATH=${{ runner.workspace }}/matrix-doc -DGTAD_PATH=${{ runner.workspace }}/gtad/gtad" >>$GITHUB_ENV + echo "CMAKE_ARGS=$CMAKE_ARGS -DMATRIX_DOC_PATH=${{ runner.workspace }}/matrix-doc \ + -DGTAD_PATH=${{ runner.workspace }}/gtad/gtad" \ + >>$GITHUB_ENV echo "QUOTEST_ORIGIN=$QUOTEST_ORIGIN and API files regeneration" >>$GITHUB_ENV - name: Configure libQuotient @@ -109,7 +108,7 @@ jobs: env: TEST_USER: ${{ secrets.TEST_USER }} TEST_PWD: ${{ secrets.TEST_PWD }} - LD_LIBRARY_PATH: "${{ env.DEP_SO_PATH }}:${{ env.Qt5_DIR }}/lib" + LD_LIBRARY_PATH: "${{ env.Qt5_DIR }}/lib" run: | [[ -z "$TEST_USER" ]] || $VALGRIND ~/.local/bin/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" timeout-minutes: 5 # quotest is supposed to finish within 3 minutes, actually -- cgit v1.2.3 From 302dbc2df4e55855d1c9a97f679101e9d40a260e Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 17:18:12 +0100 Subject: Make quotest origin even more informative --- .github/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b69d34e7..946b3073 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,14 @@ jobs: echo "CC=clang" >>$GITHUB_ENV echo "CXX=clang++" >>$GITHUB_ENV fi - echo "QUOTEST_ORIGIN=${{ github.ref }} @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV + if grep -q 'refs/tags' <<<'${{ github.ref }}'; then + VERSION="$(git describe --tags)" + elif [ '${{ github.ref }}' == 'refs/heads/master' ]; then + VERSION="ci${{ github.run_number }}-$(git rev-parse --short HEAD)" + else + VERSION="$(git describe --all --contains)-ci${{ github.run_number }}-$(git rev-parse --short HEAD)" + fi + echo "QUOTEST_ORIGIN=$VERSION @ ${{ runner.os }}/${{ matrix.compiler }}" >>$GITHUB_ENV echo "CMAKE_ARGS=-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=false \ -DCMAKE_INSTALL_PREFIX=~/.local -DCMAKE_PREFIX_PATH=~/.local" >>$GITHUB_ENV cmake -E make_directory ${{ runner.workspace }}/build -- cgit v1.2.3 From dbbd2c61c912769c8a0063454862fa2168e7afd9 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Mon, 25 Jan 2021 18:28:48 +0100 Subject: Revert to running quotest from the source tree For some reason the installed one doesn't find QtTest dynamic library. --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 946b3073..fd6f489e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,6 @@ jobs: env: TEST_USER: ${{ secrets.TEST_USER }} TEST_PWD: ${{ secrets.TEST_PWD }} - LD_LIBRARY_PATH: "${{ env.Qt5_DIR }}/lib" run: | - [[ -z "$TEST_USER" ]] || $VALGRIND ~/.local/bin/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" + [[ -z "$TEST_USER" ]] || $VALGRIND build/quotest/quotest "$TEST_USER" "$TEST_PWD" quotest-gha '#quotest:matrix.org' "$QUOTEST_ORIGIN" timeout-minutes: 5 # quotest is supposed to finish within 3 minutes, actually -- cgit v1.2.3