From 5bc2c207dbb457211ce8cf5321fa0a46f5b33deb Mon Sep 17 00:00:00 2001 From: rejas Date: Fri, 1 Jan 2021 22:18:06 +0100 Subject: [PATCH 1/7] Add codecov github action --- .github/workflows/codecov-test-suites.yml | 15 +++++++++++++++ .github/workflows/enforce-changelog.yml | 3 ++- codecov.yml | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/codecov-test-suites.yml create mode 100644 codecov.yml diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml new file mode 100644 index 00000000..d59ea530 --- /dev/null +++ b/.github/workflows/codecov-test-suites.yml @@ -0,0 +1,15 @@ +name: Run Test Suites + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: | + Xvfb :99 -screen 0 1024x768x16 & + export DISPLAY=:99 + npm install + npm run test:coverage + bash <(curl -s https://codecov.io/bash) # Upload to Codecov diff --git a/.github/workflows/enforce-changelog.yml b/.github/workflows/enforce-changelog.yml index eefa1645..1a8747c9 100644 --- a/.github/workflows/enforce-changelog.yml +++ b/.github/workflows/enforce-changelog.yml @@ -1,10 +1,11 @@ name: "Enforce Changelog" + on: pull_request: types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] jobs: - # Enforces the update of a changelog file on every pull request + # Enforces the update of a changelog file on every pull request check: runs-on: ubuntu-latest steps: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..c8db49a7 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +fixes: + - "/home/runner/work/rejas/MagicMirror/::" From 5a3d3b76a7e924cf5bad49521946ca0f127e2a2e Mon Sep 17 00:00:00 2001 From: rejas Date: Fri, 1 Jan 2021 22:47:28 +0100 Subject: [PATCH 2/7] Cleanups --- .github/workflows/codecov-test-suites.yml | 6 ++++-- .github/workflows/enforce-changelog.yml | 3 ++- .github/workflows/node-ci.js.yml | 5 +---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml index d59ea530..f44e95c6 100644 --- a/.github/workflows/codecov-test-suites.yml +++ b/.github/workflows/codecov-test-suites.yml @@ -1,4 +1,6 @@ -name: Run Test Suites +# This workflow runs the automated test and uploads the coverage results to codecov.io + +name: "Run Codecov Tests" on: [push] @@ -12,4 +14,4 @@ jobs: export DISPLAY=:99 npm install npm run test:coverage - bash <(curl -s https://codecov.io/bash) # Upload to Codecov + bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/enforce-changelog.yml b/.github/workflows/enforce-changelog.yml index 1a8747c9..67a95a48 100644 --- a/.github/workflows/enforce-changelog.yml +++ b/.github/workflows/enforce-changelog.yml @@ -1,3 +1,5 @@ +# This workflow enforces the update of a changelog file on every pull request + name: "Enforce Changelog" on: @@ -5,7 +7,6 @@ on: types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] jobs: - # Enforces the update of a changelog file on every pull request check: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/node-ci.js.yml b/.github/workflows/node-ci.js.yml index f794c941..7f6f23b1 100644 --- a/.github/workflows/node-ci.js.yml +++ b/.github/workflows/node-ci.js.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Automated Tests +name: "Run Automated Tests" on: push: @@ -11,13 +11,10 @@ on: jobs: test: - runs-on: ubuntu-latest - strategy: matrix: node-version: [10.x, 12.x, 14.x] - steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} From d75b894d9ae1ad72bd2758494b6cd1dd6966b354 Mon Sep 17 00:00:00 2001 From: rejas Date: Fri, 1 Jan 2021 23:16:45 +0100 Subject: [PATCH 3/7] Add lcov reporter --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0b010200..b83d29e8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", "postinstall": "npm run install-fonts && echo \"MagicMirror installation finished successfully! \n\"", "test": "NODE_ENV=test mocha tests --recursive", - "test:coverage": "NODE_ENV=test nyc mocha tests --recursive --timeout=3000", + "test:coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text mocha tests --recursive --timeout=3000", "test:e2e": "NODE_ENV=test mocha tests/e2e --recursive", "test:unit": "NODE_ENV=test mocha tests/unit --recursive", "test:prettier": "prettier --check **/*.{js,css,json,md,yml}", From 9cd998f219e7f2481e936b7179162c0509d9edbc Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 5 Jan 2021 09:37:57 +0100 Subject: [PATCH 4/7] Update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da48ef06..06d8d651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ _This release is scheduled to be released on 2021-04-01._ ### Added +- Added GitHub workflows for automated testing and changelog enforcement. + ### Updated - Updated markdown files. @@ -44,7 +46,6 @@ Special thanks to the following contributors: @Alvinger, @AndyPoms, @ashishtank, - Calendar: new options "limitDays" and "coloredEvents". - Added new option "limitDays" - limit the number of discreet days displayed. - Added new option "customEvents" - use custom symbol/color based on keyword in event title. -- Added GitHub workflows for automated testing and changelog enforcement. ### Updated From 003e948899752fc0b4543a2f675b83c332640caa Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 5 Jan 2021 14:02:14 +0100 Subject: [PATCH 5/7] Use codecov action instead of bash command --- .github/workflows/codecov-test-suites.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml index f44e95c6..f5f400a5 100644 --- a/.github/workflows/codecov-test-suites.yml +++ b/.github/workflows/codecov-test-suites.yml @@ -5,13 +5,16 @@ name: "Run Codecov Tests" on: [push] jobs: - test: + run-and-upload-coverage-report: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: | Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 - npm install + npm ci npm run test:coverage - bash <(curl -s https://codecov.io/bash) + - uses: codecov/codecov-action@v1 + with: + file: ./coverage/lcov.info + fail_ci_if_error: true From fa9258761e1cd681c4c69b3b8d6d40482eb9e45c Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 5 Jan 2021 14:19:06 +0100 Subject: [PATCH 6/7] Change on-trigger --- .github/workflows/codecov-test-suites.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml index f5f400a5..0d98e3a0 100644 --- a/.github/workflows/codecov-test-suites.yml +++ b/.github/workflows/codecov-test-suites.yml @@ -2,7 +2,11 @@ name: "Run Codecov Tests" -on: [push] +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] jobs: run-and-upload-coverage-report: From 6e9897f7fceec1e169ffa72a8a4a9cf685af47d4 Mon Sep 17 00:00:00 2001 From: veeck Date: Tue, 5 Jan 2021 14:41:07 +0100 Subject: [PATCH 7/7] Remove now unnecessary file --- codecov.yml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index c8db49a7..00000000 --- a/codecov.yml +++ /dev/null @@ -1,2 +0,0 @@ -fixes: - - "/home/runner/work/rejas/MagicMirror/::"