Skip to content

Commit

Permalink
Enable the flags feature of codecov, each test is one
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jun 8, 2024
1 parent 2d4e74f commit 1e2dc37
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
- name: Collecting Bats tests
id: collect-tests
run: |
echo "matrix=$(cd test && find . -name '*.bats' -not -path '*/helpers/*' -printf '%P\n'| \
# Get all the test files without extension.
echo "matrix=$(cd test && find . -iname '*.bats' -not -path '*/helpers/*' -exec basename {} .bats ';' | \
jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
test:
Expand Down Expand Up @@ -68,7 +69,7 @@ jobs:
MOODLE_CI_RUNNER_GITDIR: ${{ github.workspace }}/moodle
LOCAL_CI_PATH: ${{ github.workspace }}/local_ci
run: |
bats --timing test/${{ matrix.test }}
bats --timing test/${{ matrix.test }}.bats
coverage:
if: github.repository == 'moodlehq/moodle-ci-runner'
Expand Down Expand Up @@ -124,12 +125,12 @@ jobs:
--include-path ${{ github.workspace }}/runner/main \
--bash-parse-files-in-dir ${{ github.workspace }}/runner/main \
${{ github.workspace }}/coverage \
bats --timing ${{ github.workspace }}/test/${{ matrix.test }}
bats --timing ${{ github.workspace }}/test/${{ matrix.test }}.bats
- name: Upload code coverage (codecov)
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ github.workspace }}/coverage
verbose: true
flags: ${{ matrix.test }}

0 comments on commit 1e2dc37

Please sign in to comment.