From fed65368bf7ba7e857fdcf6f2cf4c4de56d4a2f8 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Tue, 6 Dec 2022 21:51:32 +0700 Subject: [PATCH] separate each GitHub Action steps into smaller scopes --- .github/workflows/build.yml | 39 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 313c25b..fe3933c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: with: fetch-depth: 0 - - name: Install build dependencies + - name: Install Ninja run: sudo apt install ninja-build - name: Configure CMake @@ -29,10 +29,8 @@ jobs: with: fetch-depth: 0 - - name: Install build dependencies - run: | - sudo apt install ninja-build - pip3 install gcovr + - name: Install Ninja + run: sudo apt install ninja-build - name: Configure CMake run: cmake . -B build -G Ninja -D BUILD_TESTING=ON @@ -43,18 +41,29 @@ jobs: - name: Run tests run: ctest --verbose --test-dir build --no-compress-output -T Test || true - - name: Send test result to Testspace + - name: Download Testspace client + run: curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C build + + - name: Configure Testspace client + working-directory: build run: | - curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C build - build/testspace config url ${{ secrets.TESTSPACE_URL }} - build/testspace config project ${{ secrets.TESTSPACE_PROJECT }} - build/testspace config space ${{ github.ref_name }} - build/testspace [Tests]"build/Testing/*/Test.xml" + ./testspace config url ${{ secrets.TESTSPACE_URL }} + ./testspace config project ${{ secrets.TESTSPACE_PROJECT }} + ./testspace config space ${{ github.ref_name }} + + - name: Send test result to Testspace + working-directory: build + run: ./testspace [Tests]"Testing/*/Test.xml" + + - name: Install gcovr + run: pip3 install gcovr - - name: Generate code coverage info and send to Coveralls + - name: Generate code coverage info working-directory: build env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - run: | - gcovr -r .. --exclude-directories _deps -e _deps --coveralls coverage.json - curl -v -F json_file=@coverage.json https://coveralls.io/api/v1/jobs + run: gcovr -r .. --exclude-directories _deps -e _deps --coveralls coverage.json + + - name: Send code coverage info to Coveralls + working-directory: build + run: curl -v -F json_file=@coverage.json https://coveralls.io/api/v1/jobs