From 40f76c934b19cf0540e38d07afcd9a0e14638efe Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 15:28:50 +0200 Subject: [PATCH 01/33] Add coverage check to git workflow --- .github/workflows/test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56dc42be7..3b1a1978e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -241,7 +241,16 @@ jobs: ########################################################################## - name: frontend | Unit tests run: docker run --rm gradido/frontend:test yarn run test - + ########################################################################## + # COVERAGE CHECK FRONTEND ################################################ + ########################################################################## + - name: frontend | Coverage check + uses: devmasx/coverage-check-action@v1.2.0 + with: + type: lcov + result_path: coverage/example.lcov + min_coverage: 10 + ## token: ${{ github.token }} #test: # runs-on: ubuntu-latest From 07df4b2cdc8e06fd44ad9bba6796c0ed7f68af4b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 16:25:15 +0200 Subject: [PATCH 02/33] extract coverage folder from docker image --- .github/workflows/test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b1a1978e..536e9e9ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -242,15 +242,19 @@ jobs: - name: frontend | Unit tests run: docker run --rm gradido/frontend:test yarn run test ########################################################################## + # EXTRACT coverage folder ################################################ + ########################################################################## + - name: Frontend | extract coverage folder + run: docker cp $(docker ps -aqf "ancestor=gradido/frontend:test"):/app/coverage coverage + ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## - name: frontend | Coverage check uses: devmasx/coverage-check-action@v1.2.0 with: type: lcov - result_path: coverage/example.lcov + result_path: coverage/lcov.info min_coverage: 10 - ## token: ${{ github.token }} #test: # runs-on: ubuntu-latest From e80058ebd9b27a3e441f8afe4e5a558e05af0e1c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 16:56:38 +0200 Subject: [PATCH 03/33] create docker container to get image ID --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 536e9e9ab..b5b578528 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,12 +240,12 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run --rm gradido/frontend:test yarn run test + run: docker run -d --rm gradido/frontend:test yarn run test ########################################################################## # EXTRACT coverage folder ################################################ ########################################################################## - - name: Frontend | extract coverage folder - run: docker cp $(docker ps -aqf "ancestor=gradido/frontend:test"):/app/coverage coverage + - name: frontend | Extract coverage folder + run: docker cp $(docker create gradido/frontend:test):/app/coverage coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From 34c45870ebc7016b2ce6ee583c9d769cab4d1fb4 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 17:05:02 +0200 Subject: [PATCH 04/33] try docker image ls to get container id --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5b578528..c8b391424 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,12 +240,12 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run -d --rm gradido/frontend:test yarn run test + run: docker run --rm gradido/frontend:test yarn run test ########################################################################## # EXTRACT coverage folder ################################################ ########################################################################## - name: frontend | Extract coverage folder - run: docker cp $(docker create gradido/frontend:test):/app/coverage coverage + run: docker cp $(docker image ls -q gradido/frontend:test):/app/coverage coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From 7e233b1f275455833af7150e9fbcf43eb3f5b9ca Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 17:39:22 +0200 Subject: [PATCH 05/33] get container ID by docker create --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8b391424..1eb472fff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,7 +245,7 @@ jobs: # EXTRACT coverage folder ################################################ ########################################################################## - name: frontend | Extract coverage folder - run: docker cp $(docker image ls -q gradido/frontend:test):/app/coverage coverage + run: docker cp $(docker create gradido/frontend:test):/app/coverage coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From f507372fffd1fe4b13bc144c938d0f5d2bdc7a2f Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 17:53:41 +0200 Subject: [PATCH 06/33] debugging --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1eb472fff..37fdb9b1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,7 +245,12 @@ jobs: # EXTRACT coverage folder ################################################ ########################################################################## - name: frontend | Extract coverage folder - run: docker cp $(docker create gradido/frontend:test):/app/coverage coverage + run: | + docker create gradido/frontend:test > containerID + docker container ls -a + docker image ls -a + cat containerID + docker cp $(cat containerID):/app/coverage coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From 6cd64d7cffb275b5884e282f914c324b37e4e002 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:11:45 +0200 Subject: [PATCH 07/33] test if app folder is present in container --- .github/workflows/test.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 37fdb9b1d..1d19d3188 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,12 +245,7 @@ jobs: # EXTRACT coverage folder ################################################ ########################################################################## - name: frontend | Extract coverage folder - run: | - docker create gradido/frontend:test > containerID - docker container ls -a - docker image ls -a - cat containerID - docker cp $(cat containerID):/app/coverage coverage + run: docker cp $(create gradido/frontend:test):/app coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From de21fb5a46e40de74f0a72722b96799d734e2e8a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:19:00 +0200 Subject: [PATCH 08/33] test again --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d19d3188..e8a858119 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,7 +245,7 @@ jobs: # EXTRACT coverage folder ################################################ ########################################################################## - name: frontend | Extract coverage folder - run: docker cp $(create gradido/frontend:test):/app coverage + run: docker cp $(docker create gradido/frontend:test):/app coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## From 543c41338449ff0d9c8b3dfaa96c08438c56acd7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:21:32 +0200 Subject: [PATCH 09/33] mount coverage folder when running frontend tests --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8a858119..bb9266a43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,12 +240,12 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run --rm gradido/frontend:test yarn run test + run: docker run -v ./coverage:/app/coverage --rm gradido/frontend:test yarn run test ########################################################################## # EXTRACT coverage folder ################################################ ########################################################################## - - name: frontend | Extract coverage folder - run: docker cp $(docker create gradido/frontend:test):/app coverage + # - name: frontend | Extract coverage folder + # run: docker cp $(docker create gradido/frontend:test):/app coverage ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## @@ -253,7 +253,7 @@ jobs: uses: devmasx/coverage-check-action@v1.2.0 with: type: lcov - result_path: coverage/lcov.info + result_path: ./coverage/lcov.info min_coverage: 10 #test: From 1ee07feb68e4e2f2c6d2ad87c6c0441cea92db5a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:30:58 +0200 Subject: [PATCH 10/33] volume path without dot --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb9266a43..351e12613 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,7 +240,7 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run -v ./coverage:/app/coverage --rm gradido/frontend:test yarn run test + run: docker run -v /coverage:/app/coverage --rm gradido/frontend:test yarn run test ########################################################################## # EXTRACT coverage folder ################################################ ########################################################################## @@ -253,7 +253,7 @@ jobs: uses: devmasx/coverage-check-action@v1.2.0 with: type: lcov - result_path: ./coverage/lcov.info + result_path: /coverage/lcov.info min_coverage: 10 #test: From 22bb1374ef513f9a34f3782b2ab355667ae376dc Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:41:58 +0200 Subject: [PATCH 11/33] test if coverage folder is present, added github token --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 351e12613..5f4e7c98b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -229,7 +229,7 @@ jobs: ########################################################################## # DOWNLOAD DOCKER IMAGES ################################################# ########################################################################## - - name: Download Docker Image (Webapp) + - name: Download Docker Image (Frontend) uses: actions/download-artifact@v2 with: name: docker-frontend-test @@ -244,6 +244,8 @@ jobs: ########################################################################## # EXTRACT coverage folder ################################################ ########################################################################## + - name: test presence of coverage folder + run: ls -la /coverage # - name: frontend | Extract coverage folder # run: docker cp $(docker create gradido/frontend:test):/app coverage ########################################################################## @@ -255,6 +257,7 @@ jobs: type: lcov result_path: /coverage/lcov.info min_coverage: 10 + token: ${{ github.token }} #test: # runs-on: ubuntu-latest From 1b6f88b0546f421eb88074b67b288c6aac105e99 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:47:17 +0200 Subject: [PATCH 12/33] give json to coverage check --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f4e7c98b..cbc767938 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -255,7 +255,7 @@ jobs: uses: devmasx/coverage-check-action@v1.2.0 with: type: lcov - result_path: /coverage/lcov.info + result_path: /coverage/coverage-final.json min_coverage: 10 token: ${{ github.token }} From 76ec8d885c68f28ee3f1fb972c5342f83e3fe8ec Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 18:52:46 +0200 Subject: [PATCH 13/33] change type from lcov to simplecov --- .github/workflows/test.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cbc767938..c35232086 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -242,19 +242,12 @@ jobs: - name: frontend | Unit tests run: docker run -v /coverage:/app/coverage --rm gradido/frontend:test yarn run test ########################################################################## - # EXTRACT coverage folder ################################################ - ########################################################################## - - name: test presence of coverage folder - run: ls -la /coverage - # - name: frontend | Extract coverage folder - # run: docker cp $(docker create gradido/frontend:test):/app coverage - ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## - name: frontend | Coverage check uses: devmasx/coverage-check-action@v1.2.0 with: - type: lcov + type: simplecov result_path: /coverage/coverage-final.json min_coverage: 10 token: ${{ github.token }} From b7d85aea8877e68569295817dbf7891898139e2a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:03:43 +0200 Subject: [PATCH 14/33] why is coverage not found? --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c35232086..e0b414a85 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -244,6 +244,8 @@ jobs: ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## + - name: hallo, bist du da? + run: ls -la /coverage - name: frontend | Coverage check uses: devmasx/coverage-check-action@v1.2.0 with: From 770f1bd9f705a61067dfd54760a6c86e285bc95b Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:06:29 +0200 Subject: [PATCH 15/33] why is coverage not found? --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0b414a85..fdca162de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -245,7 +245,7 @@ jobs: # COVERAGE CHECK FRONTEND ################################################ ########################################################################## - name: hallo, bist du da? - run: ls -la /coverage + run: ls -la /coverage - name: frontend | Coverage check uses: devmasx/coverage-check-action@v1.2.0 with: From fbe025d1f225b9060b969271617a280ec5f301a2 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:19:39 +0200 Subject: [PATCH 16/33] use lcov-reporter-action --- .github/workflows/test.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdca162de..185a88ffd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -244,16 +244,21 @@ jobs: ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## - - name: hallo, bist du da? - run: ls -la /coverage - - name: frontend | Coverage check - uses: devmasx/coverage-check-action@v1.2.0 + #- name: frontend | Coverage check + # uses: devmasx/coverage-check-action@v1.2.0 + # with: + # type: simplecov + # result_path: /coverage/coverage-final.json + # min_coverage: 10 + # token: ${{ github.token }} + ########################################################################## + # COVERAGE REPORT FRONTEND ################################################ + ########################################################################## + - uses: romeovs/lcov-reporter-action@v0.2.16 with: - type: simplecov - result_path: /coverage/coverage-final.json - min_coverage: 10 - token: ${{ github.token }} - + github-token: ${{ secrets.GITHUB_TOKEN }} + lcov-file: /coverage/lcov.info + #test: # runs-on: ubuntu-latest # steps: From 73a612ebb188de89d3ee93ae5c42cfe48852eac3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:35:35 +0200 Subject: [PATCH 17/33] cat content of lcov.info --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 185a88ffd..b3d9798dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -254,7 +254,9 @@ jobs: ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - - uses: romeovs/lcov-reporter-action@v0.2.16 + - name: frontend | coverage report + run: cat /coverage/lcov.info + uses: romeovs/lcov-reporter-action@v0.2.16 with: github-token: ${{ secrets.GITHUB_TOKEN }} lcov-file: /coverage/lcov.info From 03457b56ac40e26b1d5c91c8b62797f23df0fc58 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:37:25 +0200 Subject: [PATCH 18/33] cat content of lcov.info --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3d9798dd..3b4d954e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -254,8 +254,9 @@ jobs: ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - - name: frontend | coverage report + - name: show content of /coverage/lcov.info run: cat /coverage/lcov.info + - name: frontend | coverage report uses: romeovs/lcov-reporter-action@v0.2.16 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 09f5c3212e5259d4d972d617c1c9ca9323ca16b1 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:51:31 +0200 Subject: [PATCH 19/33] try paths without leading slashes --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3b4d954e6..415efacf2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -255,12 +255,12 @@ jobs: # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - name: show content of /coverage/lcov.info - run: cat /coverage/lcov.info + run: cat coverage/lcov.info - name: frontend | coverage report uses: romeovs/lcov-reporter-action@v0.2.16 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: /coverage/lcov.info + lcov-file: coverage/lcov.info #test: # runs-on: ubuntu-latest From 981a31556150e9078d879a0737afebd7f97d602c Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 8 Apr 2021 19:58:20 +0200 Subject: [PATCH 20/33] try paths without leading slashes --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 415efacf2..4bb5cad3a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -255,12 +255,12 @@ jobs: # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - name: show content of /coverage/lcov.info - run: cat coverage/lcov.info + run: cat ./coverage/lcov.info - name: frontend | coverage report uses: romeovs/lcov-reporter-action@v0.2.16 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: coverage/lcov.info + lcov-file: ./coverage/lcov.info #test: # runs-on: ubuntu-latest From 32f76315d1db6552b06199c5e9ba7ab6fabe7f04 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Apr 2021 01:00:29 +0200 Subject: [PATCH 21/33] Test Coveralls --- .github/workflows/test.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bb5cad3a..bb619b0ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -254,13 +254,20 @@ jobs: ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - - name: show content of /coverage/lcov.info - run: cat ./coverage/lcov.info - - name: frontend | coverage report - uses: romeovs/lcov-reporter-action@v0.2.16 + #- name: show content of /coverage/lcov.info + # run: cat /coverage/lcov.info + #- name: frontend | coverage report + # uses: romeovs/lcov-reporter-action@v0.2.16 + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # lcov-file: /coverage/lcov.info + ########################################################################## + # COVERALLS REPORT FRONTEND ############################################## + ########################################################################## + - name: frontend | Coveralls + uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ./coverage/lcov.info #test: # runs-on: ubuntu-latest From c619993c76532d415cf788d0911c6ef8c097f62d Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Apr 2021 01:09:06 +0200 Subject: [PATCH 22/33] added path-to-lcov: /coverage/lcov.info --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb619b0ee..d293c4070 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -268,6 +268,7 @@ jobs: uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: /coverage/lcov.info #test: # runs-on: ubuntu-latest From d2615bac86172cf47856455337c88dc773396a94 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Apr 2021 01:17:22 +0200 Subject: [PATCH 23/33] add on pull_request --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d293c4070..cdfdc9ae3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: gradido test CI -on: [push] +on: [push, pull_request] jobs: ############################################################################## From e3da6026a3ab218cd8504c024ef44f54e73ab5cb Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Tue, 13 Apr 2021 01:44:14 +0200 Subject: [PATCH 24/33] is there a coveralls-api-result file somewhere? --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdfdc9ae3..6cef031a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: gradido test CI -on: [push, pull_request] +on: [push] # , pull_request jobs: ############################################################################## @@ -269,6 +269,8 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: /coverage/lcov.info + - name: frontend | print Coveralls result + run: ls -la /coverage #test: # runs-on: ubuntu-latest From 25bc2fb094d99d7c8edd9958abab0179b99d8b09 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 22:14:13 +0200 Subject: [PATCH 25/33] coverage test --- .github/workflows/test.yml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6cef031a7..6871b07f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,7 +240,7 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run -v /coverage:/app/coverage --rm gradido/frontend:test yarn run test + run: docker run -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test ########################################################################## # COVERAGE CHECK FRONTEND ################################################ ########################################################################## @@ -254,23 +254,27 @@ jobs: ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - #- name: show content of /coverage/lcov.info - # run: cat /coverage/lcov.info - #- name: frontend | coverage report - # uses: romeovs/lcov-reporter-action@v0.2.16 - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # lcov-file: /coverage/lcov.info + - name: show content of /coverage/lcov.info + run: | + cat ~/coverage/lcov.info + ls ~/coverage + # mv /coverage/* ./coverage/ + # cat ./coverage/lcov.info + - name: frontend | coverage report + uses: romeovs/lcov-reporter-action@v0.2.16 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + lcov-file: ~/coverage/lcov.info ########################################################################## # COVERALLS REPORT FRONTEND ############################################## ########################################################################## - - name: frontend | Coveralls - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: /coverage/lcov.info - - name: frontend | print Coveralls result - run: ls -la /coverage + #- name: frontend | Coveralls + # uses: coverallsapp/github-action@master + # with: + # github-token: ${{ secrets.GITHUB_TOKEN }} + # path-to-lcov: /coverage/lcov.info + #- name: frontend | print Coveralls result + # run: ls -la /coverage #test: # runs-on: ubuntu-latest From ddee4ae0aecd44ba9fa3f10536acdb8bf9259673 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 22:26:05 +0200 Subject: [PATCH 26/33] update version coverage reporter --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6871b07f7..2b138b50b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -256,15 +256,16 @@ jobs: ########################################################################## - name: show content of /coverage/lcov.info run: | - cat ~/coverage/lcov.info ls ~/coverage + ls ./coverage + ls ./ # mv /coverage/* ./coverage/ # cat ./coverage/lcov.info - name: frontend | coverage report - uses: romeovs/lcov-reporter-action@v0.2.16 + uses: romeovs/lcov-reporter-action@v0.2.21 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ~/coverage/lcov.info + lcov-file: ./coverage/lcov.info ########################################################################## # COVERALLS REPORT FRONTEND ############################################## ########################################################################## From 296cc891fb70fa281d8210146dc02a155fb7d5e5 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 22:38:17 +0200 Subject: [PATCH 27/33] directory tests --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b138b50b..2ce362d0d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -258,14 +258,16 @@ jobs: run: | ls ~/coverage ls ./coverage - ls ./ + pwd + cd ~ + pwd # mv /coverage/* ./coverage/ # cat ./coverage/lcov.info - name: frontend | coverage report uses: romeovs/lcov-reporter-action@v0.2.21 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ./coverage/lcov.info + lcov-file: ~/coverage/lcov.info ########################################################################## # COVERALLS REPORT FRONTEND ############################################## ########################################################################## From 6da30e2b6117fb8a59250ab4f7a57b0efd99c4af Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 22:45:02 +0200 Subject: [PATCH 28/33] fix --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ce362d0d..b9c91489c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -257,7 +257,6 @@ jobs: - name: show content of /coverage/lcov.info run: | ls ~/coverage - ls ./coverage pwd cd ~ pwd From fcf2541f674ed855b6c25a237a65bf3e3fb092e4 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 22:53:00 +0200 Subject: [PATCH 29/33] use absolute path --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9c91489c..e2f21d785 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -266,7 +266,7 @@ jobs: uses: romeovs/lcov-reporter-action@v0.2.21 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: ~/coverage/lcov.info + lcov-file: /home/runner/coverage/lcov.info ########################################################################## # COVERALLS REPORT FRONTEND ############################################## ########################################################################## From 544642dddc48c1a8357d7bbe6f5a8a0b52304ad2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 23:04:47 +0200 Subject: [PATCH 30/33] use absolute path, coverage check --- .github/workflows/test.yml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e2f21d785..42d09cd7d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -240,33 +240,27 @@ jobs: # UNIT TESTS FRONTEND #################################################### ########################################################################## - name: frontend | Unit tests - run: docker run -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test - ########################################################################## - # COVERAGE CHECK FRONTEND ################################################ - ########################################################################## - #- name: frontend | Coverage check - # uses: devmasx/coverage-check-action@v1.2.0 - # with: - # type: simplecov - # result_path: /coverage/coverage-final.json - # min_coverage: 10 - # token: ${{ github.token }} + run: | + docker run -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test + mv ~/coverage ./coverage ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - - name: show content of /coverage/lcov.info - run: | - ls ~/coverage - pwd - cd ~ - pwd - # mv /coverage/* ./coverage/ - # cat ./coverage/lcov.info - name: frontend | coverage report uses: romeovs/lcov-reporter-action@v0.2.21 with: github-token: ${{ secrets.GITHUB_TOKEN }} - lcov-file: /home/runner/coverage/lcov.info + lcov-file: ./coverage/lcov.info + ########################################################################## + # COVERAGE CHECK FRONTEND ################################################ + ########################################################################## + - name: frontend | Coverage check + uses: devmasx/coverage-check-action@v1.2.0 + with: + type: lcov + result_path: ./coverage/lcov.info + min_coverage: 10 + token: ${{ github.token }} ########################################################################## # COVERALLS REPORT FRONTEND ############################################## ########################################################################## From 066dcae33f6099e393f8ed0c3f9ec4c531f84e2e Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 23:12:11 +0200 Subject: [PATCH 31/33] use copy instead --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42d09cd7d..efa6e3899 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -242,11 +242,12 @@ jobs: - name: frontend | Unit tests run: | docker run -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test - mv ~/coverage ./coverage + cp ~/coverage ./coverage ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## - - name: frontend | coverage report + # TODO: Maybe remove this later on to avoid spam? + - name: frontend | Coverage report uses: romeovs/lcov-reporter-action@v0.2.21 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 4ea8b01bd399801167ce9795eec93f673718193a Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 23:19:26 +0200 Subject: [PATCH 32/33] recursive copying --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index efa6e3899..985a315b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -242,7 +242,7 @@ jobs: - name: frontend | Unit tests run: | docker run -v ~/coverage:/app/coverage --rm gradido/frontend:test yarn run test - cp ~/coverage ./coverage + cp -r ~/coverage ./coverage ########################################################################## # COVERAGE REPORT FRONTEND ################################################ ########################################################################## From 7b5c0f76bf42da842f3d6076a7e364a9821fa7a2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 13 Apr 2021 23:30:05 +0200 Subject: [PATCH 33/33] cleanup test workflow --- .github/workflows/test.yml | 112 +------------------------------------ 1 file changed, 1 insertion(+), 111 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 985a315b2..412a763e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ name: gradido test CI -on: [push] # , pull_request +on: [push] jobs: ############################################################################## @@ -30,32 +30,6 @@ jobs: name: docker-frontend-test path: /tmp/frontend.tar - ############################################################################## - # JOB: DOCKER BUILD TEST BACKEND ############################################# - ############################################################################## - #build_test_backend: - # name: Docker Build Test - Backend - # runs-on: ubuntu-latest - # needs: [prepare] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # BUILD BACKEND DOCKER IMAGE (build) ##################################### - # ########################################################################## - # - name: backend | Build `test` image - # run: | - # docker build --target test -t "ocelotsocialnetwork/backend:test" backend/ - # docker save "ocelotsocialnetwork/backend:test" > /tmp/backend.tar - # - name: Upload Artifact - # uses: actions/upload-artifact@v2 - # with: - # name: docker-backend-test - # path: /tmp/backend.tar - ############################################################################## # JOB: DOCKER BUILD TEST LOGIN SERVER ######################################## ############################################################################## @@ -139,80 +113,6 @@ jobs: - name: frontend | Lint run: docker run --rm gradido/frontend:test yarn run lint - ############################################################################## - # JOB: LINT WEBAPP ########################################################### - ############################################################################## - #lint_webapp: - # name: Lint webapp - # runs-on: ubuntu-latest - # needs: [build_test_webapp] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # DOWNLOAD DOCKER IMAGE ################################################## - # ########################################################################## - # - name: Download Docker Image (Webapp) - # uses: actions/download-artifact@v2 - # with: - # name: docker-webapp-test - # path: /tmp - # - name: Load Docker Image - # run: docker load < /tmp/webapp.tar - # ########################################################################## - # # LINT WEBAPP ############################################################ - # ########################################################################## - # - name: webapp | Lint - # run: docker run --rm ocelotsocialnetwork/webapp:test yarn run lint - - ############################################################################## - # JOB: UNIT TEST BACKEND ##################################################### - ############################################################################## - #unit_test_backend: - # name: Unit tests - backend - # runs-on: ubuntu-latest - # needs: [build_test_neo4j,build_test_backend] - # steps: - # ########################################################################## - # # CHECKOUT CODE ########################################################## - # ########################################################################## - # - name: Checkout code - # uses: actions/checkout@v2 - # ########################################################################## - # # DOWNLOAD DOCKER IMAGES ################################################# - # ########################################################################## - # - name: Download Docker Image (Neo4J) - # uses: actions/download-artifact@v2 - # with: - # name: docker-neo4j-image - # path: /tmp - # - name: Load Docker Image - # run: docker load < /tmp/neo4j.tar - # - name: Download Docker Image (Backend) - # uses: actions/download-artifact@v2 - # with: - # name: docker-backend-test - # path: /tmp - # - name: Load Docker Image - # run: docker load < /tmp/backend.tar - # ########################################################################## - # # UNIT TESTS BACKEND ##################################################### - # ########################################################################## - # # TODO: Why do we need those .envs? - # - name: backend | copy env files webapp - # run: cp webapp/.env.template webapp/.env - # - name: backend | copy env files backend - # run: cp backend/.env.template backend/.env - # - name: backend | docker-compose - # run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps neo4j backend - # - name: backend | Initialize Database - # run: docker-compose exec -T backend yarn db:migrate init - # - name: backend | Unit test - # run: docker-compose exec -T backend yarn test - ############################################################################## # JOB: UNIT TEST FRONTEND ################################################### ############################################################################## @@ -262,16 +162,6 @@ jobs: result_path: ./coverage/lcov.info min_coverage: 10 token: ${{ github.token }} - ########################################################################## - # COVERALLS REPORT FRONTEND ############################################## - ########################################################################## - #- name: frontend | Coveralls - # uses: coverallsapp/github-action@master - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # path-to-lcov: /coverage/lcov.info - #- name: frontend | print Coveralls result - # run: ls -la /coverage #test: # runs-on: ubuntu-latest