From 92abfb3d733efca221428b1c2b49ced06f50addd Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 16 Oct 2020 10:34:01 +0300 Subject: [PATCH 1/5] Add github actions --- .github/workflows/ci-workflow.yml | 20 ++++++++++++++++++++ unit_test.txt | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/ci-workflow.yml create mode 100644 unit_test.txt diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml new file mode 100644 index 0000000..3c75872 --- /dev/null +++ b/.github/workflows/ci-workflow.yml @@ -0,0 +1,20 @@ +name: Run tests + +on: [push] + +jobs: + build_and_run: + name: Build and run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + lfs: true + - uses: actions/setup-java@v1 + with: + java-version: '13' + + - name: Build && Run + run: | + deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh" + curl -s ${deployer_url} | bash -s lbd --headless --settings ./unit_test.txt \ No newline at end of file diff --git a/unit_test.txt b/unit_test.txt new file mode 100644 index 0000000..46b6168 --- /dev/null +++ b/unit_test.txt @@ -0,0 +1,9 @@ +[bootstrap] +main_collection = /example/kenney.collectionc + +[display] +height = 256 +width = 256 + +[test] +report = 1 \ No newline at end of file From 281d42682e5ca8dbb8248772fe96848e142ea74d Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 16 Oct 2020 10:36:02 +0300 Subject: [PATCH 2/5] Remove liveupdate settings paths --- liveupdate.settings | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/liveupdate.settings b/liveupdate.settings index 10a44f5..6d746e9 100644 --- a/liveupdate.settings +++ b/liveupdate.settings @@ -1,6 +1,4 @@ [liveupdate] mode = Zip -zip-filepath = /Users/insality/code/defold/defold-eva/dist -supported-versions = "1.0.0" -publickey = /Users/insality/code/provisions/liveupdate/public.der -privatekey = /Users/insality/code/provisions/liveupdate/private.der \ No newline at end of file +supported-versions = + From b5e5d0fed01f8903e5b9316e3abf549abc5c2721 Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 16 Oct 2020 10:41:11 +0300 Subject: [PATCH 3/5] Add test collection --- game.project | 1 + test/test.collection | 37 +++++++++++++++++++++++++++++++++++++ test/test.script | 16 ++++++++++++++++ unit_test.txt | 2 +- 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 test/test.collection create mode 100644 test/test.script diff --git a/game.project b/game.project index 9f58436..e52b03a 100644 --- a/game.project +++ b/game.project @@ -11,6 +11,7 @@ height = 900 [project] title = druid version = 0.5.0 +dependencies = https://github.com/insalitygames/deftest/archive/master.zip [library] include_dirs = druid diff --git a/test/test.collection b/test/test.collection new file mode 100644 index 0000000..cbbebb6 --- /dev/null +++ b/test/test.collection @@ -0,0 +1,37 @@ +name: "default" +scale_along_z: 0 +embedded_instances { + id: "test" + data: "components {\n" + " id: \"test\"\n" + " component: \"/test/test.script\"\n" + " position {\n" + " x: 0.0\n" + " y: 0.0\n" + " z: 0.0\n" + " }\n" + " rotation {\n" + " x: 0.0\n" + " y: 0.0\n" + " z: 0.0\n" + " w: 1.0\n" + " }\n" + "}\n" + "" + position { + x: 0.0 + y: 0.0 + z: 0.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale3 { + x: 1.0 + y: 1.0 + z: 1.0 + } +} diff --git a/test/test.script b/test/test.script new file mode 100644 index 0000000..b2eb07f --- /dev/null +++ b/test/test.script @@ -0,0 +1,16 @@ +local deftest = require "deftest.deftest" + +local tests = { + -- Test list +} + + +function init(self) + print('[DefTest]: Init of DefTest') + for i = 1, #tests do + deftest.add(tests[i]) + end + + local is_report = (sys.get_config("test.report") == "1") + deftest.run({ coverage = { enabled = is_report } }) +end diff --git a/unit_test.txt b/unit_test.txt index 46b6168..eeec6a9 100644 --- a/unit_test.txt +++ b/unit_test.txt @@ -1,5 +1,5 @@ [bootstrap] -main_collection = /example/kenney.collectionc +main_collection = /test/test.collectionc [display] height = 256 From f45617be5b6c644c98302518af6d7ea61c3201d0 Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 16 Oct 2020 10:43:46 +0300 Subject: [PATCH 4/5] Return push test result step --- .github/workflows/ci-workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index 3c75872..bcb725b 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -17,4 +17,7 @@ jobs: - name: Build && Run run: | deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh" - curl -s ${deployer_url} | bash -s lbd --headless --settings ./unit_test.txt \ No newline at end of file + curl -s ${deployer_url} | bash -s lbd --headless --settings ./unit_test.txt + + - name: Upload test report + run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file From 9ecb7daa450601f9277db5ed5836607ab3b12970 Mon Sep 17 00:00:00 2001 From: Insality Date: Fri, 16 Oct 2020 10:47:59 +0300 Subject: [PATCH 5/5] Add github actions badges --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2f00cad..d86c1b9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![](media/druid_logo.png)](https://insality.github.io/druid/) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/insality/druid)](https://github.com/Insality/druid/releases) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/insality/druid/Run%20tests)](https://github.com/Insality/druid/actions) +[![codecov](https://codecov.io/gh/Insality/druid/branch/master/graph/badge.svg)](https://codecov.io/gh/Insality/druid) **Druid** - powerful Defold component UI library. Use basic and extended **Druid** components or make your own game-specific components to make amazing GUI in your games.