diff --git a/.github/workflows/test_on_push.yaml b/.github/workflows/test_on_push.yaml index 775739a4..8bbcde1d 100644 --- a/.github/workflows/test_on_push.yaml +++ b/.github/workflows/test_on_push.yaml @@ -46,6 +46,7 @@ jobs: vshard-version: "0.1.41" - tarantool-version: "master" vshard-version: "master" + s3-upload: true runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -130,13 +131,33 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run tests - if: matrix.coveralls != true # See https://github.com/actions/runner/issues/1173 + if: >- + matrix.coveralls != true && + (matrix.s3-upload != true || + (github.ref_type != 'tag' && github.ref_name != 'master')) run: make -C build luatest-no-coverage - name: Run tests with coverage and send results to coveralls.io if: ${{ matrix.coveralls }} run: make -C build coveralls + - name: Run tests with coverage and generate report + if: matrix.s3-upload && (github.ref_type == 'tag' || github.ref_name == 'master') + run: make -C build coverage + + - name: Upload coverage report to S3 + if: matrix.s3-upload && (github.ref_type == 'tag' || github.ref_name == 'master') + uses: tarantool/actions/s3-upload-file@master + with: + access-key-id: ${{ secrets.COVERAGE_S3_ACCESS_KEY_ID }} + secret-access-key: ${{ secrets.COVERAGE_S3_SECRET_ACCESS_KEY }} + bucket: packages + source: luacov.report.out + destination: >- + tarantooldb/dev/coverage-reports/modules/crud/${{ + github.ref_type == 'tag' && github.ref_name || 'master' + }}/luacov.report.out + run-tests-ee: if: github.event_name == 'push' strategy: diff --git a/CMakeLists.txt b/CMakeLists.txt index e8ddefa1..d9326055 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,8 @@ add_custom_target(coverage ) if(DEFINED ENV{GITHUB_TOKEN}) - set(COVERALLS_COMMAND ${LUACOVCOVERALLS} -v -r ${PROJECT_SOURCE_DIR} --repo-token $ENV{GITHUB_TOKEN}) + set(COVERALLS_COMMAND ${LUACOVCOVERALLS} -o coveralls.json -v -r ${PROJECT_SOURCE_DIR} + --repo-token $ENV{GITHUB_TOKEN}) else() set(COVERALLS_COMMAND ${CMAKE_COMMAND} -E echo "Skipped uploading to coveralls.io: no token.") endif() diff --git a/deps.sh b/deps.sh index 80ad017e..6e0dec42 100755 --- a/deps.sh +++ b/deps.sh @@ -16,6 +16,7 @@ fi # Test dependencies: ${TTCTL} rocks install luatest 1.0.1 ${TTCTL} rocks install luacheck 0.26.0 +${TTCTL} rocks install luacov 0.13.0 if [[ -n "${CARTRIDGE_VERSION}" ]] then