Skip to content

Commit

Permalink
Install into root directory instead of subdir
Browse files Browse the repository at this point in the history
It's good practice to install the repo being
tested in root/workspace directory instead
of subdir. Others (moodle, coverage...) can
go to subdirs without problem.

That way some integrations (kcov, codecov.io)
work better by default without having to
tweak or configure anything in their
default behaviour.
  • Loading branch information
stronk7 committed Nov 23, 2023
1 parent d8badc9 commit 157b794
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
path: moodle-ci-runner

- name: Collecting Bats tests
id: collect-tests
run: |
echo "matrix=$(cd moodle-ci-runner/test && find . -name '*.bats' -not -path '*/helpers/*' -printf '%P\n'| \
echo "matrix=$(cd test && find . -name '*.bats' -not -path '*/helpers/*' -printf '%P\n'| \
jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
test:
Expand All @@ -39,7 +38,6 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
path: moodle-ci-runner

- name: Checking out Moodle
uses: actions/checkout@v4
Expand All @@ -63,7 +61,7 @@ jobs:
env:
MOODLE_CI_RUNNER_GITDIR: ${{ github.workspace }}/moodle
run: |
bats --timing moodle-ci-runner/test/${{ matrix.test }}
bats --timing test/${{ matrix.test }}
coverage:
if: github.repository == 'moodlehq/moodle-ci-runner'
Expand All @@ -80,7 +78,6 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
path: moodle-ci-runner

- name: Checking out Moodle
uses: actions/checkout@v4
Expand All @@ -106,10 +103,10 @@ jobs:
run: |
kcov \
--clean \
--include-path ${{ github.workspace }}/moodle-ci-runner/runner/main \
--bash-parse-files-in-dir ${{ github.workspace }}/moodle-ci-runner/runner/main \
--include-path ${{ github.workspace }}/runner/main \
--bash-parse-files-in-dir ${{ github.workspace }}/runner/main \
${{ github.workspace }}/coverage \
bats ${{ github.workspace }}/moodle-ci-runner/test/
bats ${{ github.workspace }}/test/
- name: Archive code coverage
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 157b794

Please sign in to comment.