From a7bd7854111e119ac9f313b9ec3b85a28cecc489 Mon Sep 17 00:00:00 2001 From: Timofey Shalnev <99738815+extio1@users.noreply.github.com> Date: Tue, 28 May 2024 19:44:37 +0700 Subject: [PATCH] on_pull_request.yml is working Added downloading of boost and it usage in build and test --- .github/workflows/on_pull_request.yml | 62 +++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/.github/workflows/on_pull_request.yml b/.github/workflows/on_pull_request.yml index 5e031fe..9ffe845 100644 --- a/.github/workflows/on_pull_request.yml +++ b/.github/workflows/on_pull_request.yml @@ -7,20 +7,51 @@ on: - 'dev' jobs: + download-dependencies: + runs-on: ubuntu-latest + steps: + - run: mkdir install-artifacts + - name: Download dependencies + run: | + wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz + + - name: Save artifacts + uses: actions/upload-artifact@v4 + with: + name: dependencies-artifact + path: boost_1_80_0.tar.gz + build: + needs: [download-dependencies] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: mkdir build - - run: cmake -Bbuild - - run: cmake --build build - - uses: actions/upload-artifact@v4 + - uses: actions/download-artifact@v4 + with: + name: dependencies-artifact + + - name: Install Boost + run: | + tar -xzf boost_1_80_0.tar.gz + cd boost_1_80_0 + ./bootstrap.sh --with-libraries=serialization + sudo ./b2 install + + - name: Build project + run: | + mkdir build + cmake -Bbuild + cmake --build build + + - name: Save artifacts + uses: actions/upload-artifact@v4 with: name: build-artifacts path: build + test: - needs: [build] + needs: [build, download-dependencies] runs-on: ubuntu-latest steps: @@ -29,6 +60,21 @@ jobs: with: name: build-artifacts path: build - - run: chmod +x build/test/model/* - - run: chmod +x build/test/controller/* - - run: GTEST_COLOR=1 ctest -V --test-dir build/ + - uses: actions/download-artifact@v4 + with: + name: dependencies-artifact + + - name: Install Boost + run: | + tar -xzf boost_1_80_0.tar.gz + cd boost_1_80_0 + ./bootstrap.sh --with-libraries=serialization + sudo ./b2 install + + - name: Add lanch permissions for text executables + run: | + chmod +x build/test/model/* + chmod +x build/test/controller/* + + - name: Run tests + run: GTEST_COLOR=1 ctest -V --test-dir build/