Skip to content

Commit

Permalink
Load artifacts on failed build
Browse files Browse the repository at this point in the history
  • Loading branch information
Gennady Pospelov committed Jun 13, 2020
1 parent e6d2be3 commit 0167daf
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: linux-build
name: Linux

on:
push:
Expand Down Expand Up @@ -60,15 +60,9 @@ jobs:
ccache -s
ctest -j4
# - name: Functional test output
# if: failure()
# run: |
# cd $GITHUB_WORKSPACE/build
# cat Testing/Temporary/LastTest.log

- name: upload test logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: LastTest.log
path: /home/runner/work/qt-mvvm/qt-mvvm/build/Testing/Temporary/LastTest.log
path: ./build/Testing/Temporary/LastTest.log
17 changes: 12 additions & 5 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: macos-build
name: MacOS

on:
push:
Expand Down Expand Up @@ -71,9 +71,16 @@ jobs:
ccache -s
ctest -j4
- name: Functional test output
- name: upload test logs
uses: actions/upload-artifact@v2
if: failure()
run: |
cd $GITHUB_WORKSPACE/build
cat Testing/Temporary/LastTest.log
with:
name: LastTest.log
path: ./build/Testing/Temporary/LastTest.log

# - name: Functional test output
# if: failure()
# run: |
# cd $GITHUB_WORKSPACE/build
# cat Testing/Temporary/LastTest.log

2 changes: 1 addition & 1 deletion .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: windows-build
name: Windows

env:
CCACHE_VERSION: 3.7.7
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Model View ViewModel framework for large C++ Qt applications

![aaa](https://github.com/gpospelov/qt-mvvm/workflows/linux-build/badge.svg?branch=ci-test)

[![Linux](https://github.com/gpospelov/qt-mvvm/workflows/linux-build/badge.svg?branch=ci-test)](https://github.com/gpospelov/qt-mvvm/actions?query=workflow%3Alinux-build)
[![Linux](https://github.com/gpospelov/qt-mvvm/workflows/linux-build/badge.svg?branch=ci-test)](https://github.com/gpospelov/qt-mvvm/actions?query=workflow%3ALinux)
[![Windows](https://github.com/gpospelov/qt-mvvm/workflows/lwindows-build/badge.svg?branch=ci-test)](https://github.com/gpospelov/qt-mvvm/actions?query=workflow%3AWindows)
[![Mac OS](https://github.com/gpospelov/qt-mvvm/workflows/macos-build/badge.svg?branch=ci-test)](https://github.com/gpospelov/qt-mvvm/actions?query=workflow%3AMacOS)


[![Travis-CI Build Status](https://travis-ci.org/gpospelov/qt-mvvm.svg?branch=master)](https://travis-ci.org/gpospelov/qt-mvvm)
Expand Down
6 changes: 4 additions & 2 deletions source/libmvvm_model/mvvm/serialization/jsondocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ void JsonDocument::load(const std::string& file_name)

ModelView::JsonModelConverter converter;
int index(0);
for (auto model : p_impl->models)
converter.json_to_model(array.at(index++).toObject(), *model);
for (auto model : p_impl->models) {
converter.json_to_model(array.at(index).toObject(), *model);
++index;
}

file.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ void JsonModelConverter::json_to_model(const QJsonObject& json, SessionModel& mo
throw std::runtime_error("JsonModel::json_to_model() -> Error. Invalid json object.");

if (json[modelKey].toString() != QString::fromStdString(model.modelType()))
throw std::runtime_error("JsonModel::json_to_model() -> Unexpected model type.");
throw std::runtime_error("JsonModel::json_to_model() -> Unexpected model type '"
+ model.modelType() + "', json key '"
+ json[modelKey].toString().toStdString() + "'");

auto converter = std::make_unique<JsonItemConverter>(model.factory());

Expand Down

0 comments on commit 0167daf

Please sign in to comment.