Skip to content

Commit

Permalink
Added coverage for CircleCI.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed May 26, 2024
1 parent 33ebf0a commit 9e18a97
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ job-test: &job-test
sudo ldconfig
echo "export LD_LIBRARY_PATH=/usr/local/lib" >> $BASH_ENV
- run:
name: Install PCOV
command: |
sudo pecl install pcov
echo "extension=pcov.so" | sudo tee -a /usr/local/etc/php/conf.d/pcov.ini
echo "pcov.enabled=1" | sudo tee -a /usr/local/etc/php/conf.d/pcov.ini
- run:
name: Assemble the codebase
command: .devtools/assemble.sh
Expand Down Expand Up @@ -72,20 +79,22 @@ job-test: &job-test
command: vendor/bin/phpunit || [ "${CI_TEST_IGNORE_FAILURE:-0}" -eq 1 ]
working_directory: build

- run:
name: Process artifacts
command: |
if [ -d "build/web/sites/simpletest/browser_output" ]; then
mkdir -p /tmp/artifacts/simpletest
cp -Rf "build/web/sites/simpletest/browser_output/." /tmp/artifacts/simpletest
fi
when: always

- store_test_results:
path: /tmp/test_results
path: .logs/test_results

- store_artifacts:
path: /tmp/artifacts
path: build/web/sites/simpletest/browser_output

- store_artifacts:
path: .logs/coverage

- run:
name: Upload code coverage reports to Codecov
command: |
if [ -n "${CODECOV_TOKEN}" ] && [ -d .logs/coverage/phpunit ]; then
curl -Os https://cli.codecov.io/latest/linux/codecov && sudo chmod +x codecov
./codecov --verbose upload-process --fail-on-error -n "circleci-$CIRCLE_JOB" -s .logs/coverage
fi
jobs:
test-php-8.2:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
working-directory: build
run: vendor/bin/phpunit || [ "${CI_TEST_IGNORE_FAILURE:-0}" -eq 1 ]

- name: Process artifacts
- name: Upload test results as an artifact
uses: actions/upload-artifact@v4
with:
name: Artifacts (${{ matrix.name }})
Expand Down

1 comment on commit 9e18a97

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.