Skip to content

Commit

Permalink
Explicitly require artifacts when they should be present
Browse files Browse the repository at this point in the history
That is, when coverage is enabled, or TAP output is available (ie from
Qt 5.12 onwards).

Squashed commit of the following:

commit ab75d20
Author: Paul Colby <git@colby.id.au>
Date:   Sat Dec 16 23:19:38 2023 +1100

    Use correct step id for tap output

commit 0418a00
Author: Paul Colby <git@colby.id.au>
Date:   Sat Dec 16 23:05:01 2023 +1100

    Convert boolean strings to booleans via fromJSON

commit db469b2
Author: Paul Colby <git@colby.id.au>
Date:   Sat Dec 16 22:08:50 2023 +1100

    Explicitly require artifacts when TAP output is available

    That is, from Qt 5.12 onwards.
  • Loading branch information
pcolby committed Dec 16, 2023
1 parent 81d52ed commit 97e604e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build and Test

on: [push, pull_request]

# \todo The test-related if-no-files-found settings could be ignore for pre-Qt 5.12 and error otherwise.

jobs:
linux0:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,6 +36,7 @@ jobs:
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
Expand All @@ -46,14 +45,15 @@ jobs:
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: ignore
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
Expand Down Expand Up @@ -123,6 +123,7 @@ jobs:
run: |
cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_COVERAGE=${{ matrix.env.coverage }} -S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP"
"$RUNNER_TEMP/src/cli/dokit" --version
- name: Test
Expand All @@ -131,14 +132,15 @@ jobs:
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: ignore
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
Expand Down Expand Up @@ -212,6 +214,7 @@ jobs:
-D ENABLE_COVERAGE=${{ matrix.env.coverage }} \
-S "$GITHUB_WORKSPACE" -B "$RUNNER_TEMP"
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
cmake --build "$RUNNER_TEMP" -- VERBOSE=1
find "$RUNNER_TEMP" -name 'Info.plist'
find "$RUNNER_TEMP" -name 'Info.plist' -execdir cat '{}' \;
Expand All @@ -222,14 +225,15 @@ jobs:
if: matrix.env.coverage
run: cmake --build "$RUNNER_TEMP" --target coverage
- name: Upload test results
if: matrix.env.coverage || fromJSON(steps.build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.build.outputs.dokitVersion }}
path: |
${{ runner.temp }}/coverage.info
${{ runner.temp }}/removeHtmlDates.sh
${{ runner.temp }}/test/**/*.tap
if-no-files-found: ignore
if-no-files-found: error
- name: Report parallel coverage to Codacy
if: matrix.env.coverage && github.event_name == 'push' && github.actor != 'dependabot[bot]'
env:
Expand Down Expand Up @@ -355,7 +359,9 @@ jobs:
- name: Capture build-output variables
id: post-build
shell: bash
run: echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
run: |
echo "dokitVersion=$(cat "$RUNNER_TEMP/version.txt")" | tee -a "$GITHUB_OUTPUT"
{ echo -n 'tap='; [[ '${{ matrix.qt }}' =~ ^5\.1[2-9]|6 ]] && echo true || echo false; } | tee -a "$GITHUB_OUTPUT"
- name: Install DLL for tests
run: |
copy /v /b src\lib\${{ matrix.dll }} /b test\unit\cli
Expand All @@ -365,12 +371,12 @@ jobs:
if: matrix.arch != 'arm64'
run: ctest --output-on-failure --test-dir "%RUNNER_TEMP%" --verbose
- name: Upload test results
if: matrix.arch != 'arm64'
if: matrix.arch != 'arm64' && fromJSON(steps.post-build.outputs.tap)
uses: actions/upload-artifact@v4
with:
name: test-results-${{ steps.post-build.outputs.dokitVersion }}
path: ${{ runner.temp }}/test/**/*.tap
if-no-files-found: ignore
if-no-files-found: error
- name: Make portable
if: matrix.arch != 'arm64'
run: |
Expand Down

0 comments on commit 97e604e

Please sign in to comment.