Implement QCoroFuture::takeResult (fixes #217) #406
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, edited] | |
env: | |
BUILD_TYPE: Debug | |
QTEST_FUNCTION_TIMEOUT: 60000 | |
jobs: | |
detect_run: | |
name: Check changes | |
outputs: { "source_code_changed": "${{ steps.source_code_changed.outputs.source_code_changed}}" } | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- id: changed_files | |
uses: tj-actions/changed-files@v41 | |
name: Get changed files | |
with: | |
files_ignore: | | |
docs/** | |
docker/** | |
requirements.txt | |
mkdocs.yml | |
README.md | |
.github/** | |
- id: source_code_changed | |
name: Check for source code changes | |
if: steps.changed_files.outputs.any_changed == 'true' | |
run: | | |
echo "Detected changed files:" | |
echo "${{ steps.changed_files.outputs.all_changed_files }}" | |
echo "::set-output name=source_code_changed::true" | |
generate-matrix: | |
name: Generate build matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- id: set-matrix | |
name: Generate matrix | |
run: | | |
matrix_json=$(python3 ./.github/workflows/generate-matrix.py --platform=linux) | |
echo "::set-output name=matrix::${matrix_json}" | |
build: | |
needs: [ generate-matrix, detect_run ] | |
strategy: | |
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
fail-fast: false | |
defaults: | |
run: | |
shell: bash -l {0} | |
runs-on: ${{ matrix.runs_on }} | |
name: ${{ matrix.platform }}-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }} | |
container: | |
image: ghcr.io/${{ github.repository }}/build-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }}:main | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' }} | |
- name: Create Build Environment | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' }} | |
run: | | |
cmake -E make_directory build | |
- name: Configure CMake | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' }} | |
run: | | |
QT_VERSION_MAJOR=$(echo ${{ matrix.qt_version }} | cut -d'.' -f1) | |
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DBUILD_SHARED_LIBS=ON" | |
# Disable ASAN for clang-11 - we are hitting some bugs in ASAN & generators | |
if [[ "${{ matrix.compiler }}" == "clang" && "${{ matrix.compiler_version }}" == "11" ]]; then | |
EXTRA_CMAKE_FLAGS="${EXTRA_CMAKE_FLAGS} -DQCORO_ENABLE_ASAN=OFF" | |
fi | |
cmake -B build \ | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |
-DUSE_QT_VERSION=$QT_VERSION_MAJOR \ | |
-DQCORO_WITH_QTDBUS=${{ matrix.with_qtdbus }} \ | |
-DQCORO_ENABLE_ASAN=ON \ | |
${EXTRA_CMAKE_FLAGS} | |
- name: Build | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' }} | |
run: | | |
cmake --build build --config $BUILD_TYPE --parallel $(nproc) --verbose | |
- name: Test | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' }} | |
run: | | |
cd build | |
QT_LOGGING_TO_CONSOLE=1 ctest -C $BUILD_TYPE \ | |
--output-on-failure \ | |
--verbose \ | |
--output-junit ${{ matrix.platform }}-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }}.xml | |
- name: Upload Test Results | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' && always() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Unit Tests Results (${{ matrix.platform }}-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }}) | |
path: | | |
${{ github.workspace }}/build/${{ matrix.platform }}-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }}.xml | |
- name: Upload build logs on failure | |
if: ${{ needs.detect_run.outputs.source_code_changed == 'true' && failure() }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-${{ matrix.platform }}-${{ matrix.compiler_full }}-qt-${{ matrix.qt_version }} | |
path: build/** | |
event_file: | |
name: "Event File" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Event File | |
path: ${{ github.event_path }} |