Check master branch test coverage #2641
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Требования: | |
# - Тесты должны запускаться при каждом изменении в ветке, чтобы корректно рассчитывалось покрытие тестами при | |
# последующих изменениях. | |
# - В джобах точечно указываем пакеты, для которых проверяется покрытие. | |
# | |
name: Branch test coverage | |
run-name: Check ${{ github.ref_name }} branch test coverage | |
on: | |
push: | |
branches: | |
- master | |
- '*-stable' | |
concurrency: | |
group: branch-test-coverage-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
# Создаем кэш для LFS в мастере, чтобы другие ветки могли его получить. | |
# Кэш требуется для того, чтобы не превышать лимиты GitHub | |
lfs: | |
runs-on: ubuntu-latest | |
name: Create LFS cache | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Checkout LFS objects | |
uses: ./.github/actions/lfs | |
test: | |
name: Call reusable unit tests workflow | |
uses: ./.github/workflows/reusable_workflow_test.yml | |
with: | |
workspace: '@vkontakte/vkui' | |
deploy_test_coverage: | |
if: ${{ !cancelled() && (success() || failure()) }} | |
needs: test | |
runs-on: ubuntu-latest | |
name: Deploy test coverage | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download test artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-output | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unittests | |
files: .nyc_output/coverage-final.json | |
fail_ci_if_error: true | |
verbose: true |