Skip to content

Upload test results to Codecov in CI workflow #1063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ on:
tags:
- "*"

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
COMPOSER_ROOT_VERSION: "1.99.99"

jobs:

lint:
Expand Down Expand Up @@ -76,14 +67,20 @@ jobs:
- uses: "ramsey/composer-install@v3"
- name: "Run unit tests"
run: "./vendor/bin/phpunit --colors=always --coverage-clover build/logs/clover.xml --coverage-text"
- name: "Publish coverage report to Codecov"
- name: "Upload coverage reports to Codecov"
uses: "codecov/codecov-action@v5"
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}

- name: "Upload test results to Codecov"
uses: "codecov/test-results-action@v1"
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}

unit-tests:
name: "Unit Tests"
needs: ["lint"]
runs-on: "ubuntu-latest"
strategy:
fail-fast: true
Expand All @@ -97,6 +94,10 @@ jobs:
coverage: "none"
ini-values: "memory_limit=-1, zend.assertions=1, error_reporting=-1, display_errors=On"
tools: "composer"
- uses: "actions/cache@v4"
with:
path: "vendor"
key: "${{ matrix.os }}-${{ matrix.php }}-${{ matrix.laravel }}-vendor-${{ hashFiles('**/composer.lock') }}"
- name: "Prepare for tests"
run: "mkdir -p build/logs"
- uses: "ramsey/composer-install@v3"
Expand Down