Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ comment:
require_changes: no

fixes:
- "nextcloud/apps/cookbook/::"
- "/workdir/nextcloud/apps/cookbook/::"
5 changes: 5 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: The test may fail
required: false
default: false
outputs:
silentFail:
description: If the test failed but was allowed to do so
value: ${{ steps.run-docker.outputs.silent-fail }}

runs:
using: 'composite'
Expand Down Expand Up @@ -87,6 +91,7 @@ runs:
-v "$GITHUB_WORKSPACE/cookbook":/app:ro
docker-tests
name: Run the test container
id: run-docker
shell: bash

- name: Stop helper containers
Expand Down
5 changes: 5 additions & 0 deletions .github/actions/run-tests/tests/test-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ trap 'catch $? $LINENO' EXIT

catch()
{
echo '::set-output name=silent-fail::false';

if [ "$1" != '0' ]; then
echo "::error line=$LINENO::Error during the test run: $1"

if [ "$ALLOW_FAILURE" = 'true' ]; then
echo '::set-output name=silent-fail::true'
exit 0
else
exit $1
Expand Down Expand Up @@ -139,6 +142,8 @@ echo 'Tests finished'
echo 'Copy code coverage in HTML format'
cp -r coverage $GITHUB_WORKSPACE
cp -r coverage-integration $GITHUB_WORKSPACE
cp coverage.xml $GITHUB_WORKSPACE
cp coverage.integration.xml $GITHUB_WORKSPACE

popd

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:

- name: Run the tests in docker container
uses: ./cookbook/.github/actions/run-tests
id: run-tests
with:
db: ${{ matrix.database }}
phpVersion: ${{ matrix.phpVersion }}
Expand All @@ -80,8 +81,10 @@ jobs:
- name: Upload the coverage reports to codecov.io
shell: bash
run: >-
bash <(curl -s https://codecov.io/bash) -cF unittests -f nextcloud/apps/cookbook/coverage.xml &&
bash <(curl -s https://codecov.io/bash) -cF integration -f nextcloud/apps/cookbook/coverage.integration.xml
cd nextcloud/apps/cookbook &&
bash <(curl -s https://codecov.io/bash) -F unittests -f coverage.xml -R . &&
bash <(curl -s https://codecov.io/bash) -F integration -f coverage.integration.xml -R .
if: ${{ steps.run-tests.outputs.silentFail == 'false' }}

- name: Upload the code coverage report (unit tests)
uses: actions/upload-artifact@v2
Expand All @@ -90,6 +93,9 @@ jobs:
path: |
coverage/
coverage-integration/
coverage.xml
coverage.integration.xml
if: ${{ steps.run-tests.outputs.silentFail == 'false' }}


source-package:
Expand Down