From 8823e78ad6810156898ca0255ed384d64f8f2722 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 07:54:17 +0300 Subject: [PATCH 1/9] ci(): refactor test workflows --- .github/workflows/browser-firefox.yml | 25 ---------------- ...browser-chrome.yml => testing-browser.yml} | 13 ++++++--- .../{node-unit-tests.yml => testing-node.yml} | 9 +++--- .github/workflows/visual-node.yml | 29 ------------------- .github/workflows/visual-test-chrome.yml | 25 ---------------- .github/workflows/visual-test-firefox.yml | 25 ---------------- 6 files changed, 14 insertions(+), 112 deletions(-) delete mode 100644 .github/workflows/browser-firefox.yml rename .github/workflows/{browser-chrome.yml => testing-browser.yml} (56%) rename .github/workflows/{node-unit-tests.yml => testing-node.yml} (74%) delete mode 100644 .github/workflows/visual-node.yml delete mode 100644 .github/workflows/visual-test-chrome.yml delete mode 100644 .github/workflows/visual-test-firefox.yml diff --git a/.github/workflows/browser-firefox.yml b/.github/workflows/browser-firefox.yml deleted file mode 100644 index 914fe9d22ed..00000000000 --- a/.github/workflows/browser-firefox.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the library, run testem for firefox - -name: Unit tests on Firefox - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - firefox-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Unit tests on Firefox - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: npm ci - - run: npm run build -- -f - - name: Run headless test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run test -- -s unit -p 8080 -c firefox diff --git a/.github/workflows/browser-chrome.yml b/.github/workflows/testing-browser.yml similarity index 56% rename from .github/workflows/browser-chrome.yml rename to .github/workflows/testing-browser.yml index 3c81a6878b4..d4e8fc74972 100644 --- a/.github/workflows/browser-chrome.yml +++ b/.github/workflows/testing-browser.yml @@ -1,6 +1,6 @@ # This workflow will do a clean install of node dependencies, build the library, run testem for chrome -name: Unit tests on Chrome +name: Browser Unit Tests on: push: @@ -11,15 +11,20 @@ on: jobs: chrome-tests: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + suite: [unit, visual] + target: [chrome, firefox] steps: - uses: actions/checkout@v2 - name: Unit tests on Chrome uses: actions/setup-node@v1 - with: - node-version: 16.x + # with: + # node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build -- -f - name: Run headless test uses: GabrielBB/xvfb-action@v1 with: - run: npm run test -- -s unit -p 8080 -c chrome + run: npm run test -- -s ${{ matrix.suite }} -c ${{ matrix.target }} diff --git a/.github/workflows/node-unit-tests.yml b/.github/workflows/testing-node.yml similarity index 74% rename from .github/workflows/node-unit-tests.yml rename to .github/workflows/testing-node.yml index 6f1379d8032..c8de7a69221 100644 --- a/.github/workflows/node-unit-tests.yml +++ b/.github/workflows/testing-node.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: Node Unit tests +name: Node Unit Tests on: push: @@ -15,10 +15,11 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + suites: [unit, visual] steps: - uses: actions/checkout@v2 + - name: Install `node-canvas` - run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 @@ -26,4 +27,4 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build -- -f - - run: npm run test -- -s unit -p 8080 -c node + - run: npm run test -- -s ${{ matrix.suite }} -p 8080 -c node diff --git a/.github/workflows/visual-node.yml b/.github/workflows/visual-node.yml deleted file mode 100644 index e7c07d06c20..00000000000 --- a/.github/workflows/visual-node.yml +++ /dev/null @@ -1,29 +0,0 @@ -# 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: Node visual unit tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - node-visual-tests: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - node-version: [16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - uses: actions/checkout@v2 - - run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build -- -f -x gestures,accessors - - run: npm run test -- -s visual -p 8080 -c node diff --git a/.github/workflows/visual-test-chrome.yml b/.github/workflows/visual-test-chrome.yml deleted file mode 100644 index 35e24444fa6..00000000000 --- a/.github/workflows/visual-test-chrome.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the library, run testem visual tests for Chrome - -name: Visual unit tests on Chrome - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - chrome-visual-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Visual unit tests on Chrome - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: npm ci - - run: npm run build -- -f -x gestures,accessors - - name: Run headless test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run test -- -s visual -p 8080 -c chrome diff --git a/.github/workflows/visual-test-firefox.yml b/.github/workflows/visual-test-firefox.yml deleted file mode 100644 index 177b32a31ae..00000000000 --- a/.github/workflows/visual-test-firefox.yml +++ /dev/null @@ -1,25 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the library, run testem visual tests for Firefox - -name: Visual unit tests on Firefox - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - firefox-visual-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Unit tests on Firefox - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: npm ci - - run: npm run build -- -f -x gestures,accessors - - name: Run headless test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run test -- -s visual -p 8080 -c firefox From fb16005d545f18375b19e3d188797cd28be3e416 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 07:57:21 +0300 Subject: [PATCH 2/9] Update testing-browser.yml --- .github/workflows/testing-browser.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing-browser.yml b/.github/workflows/testing-browser.yml index d4e8fc74972..1d3a31242f8 100644 --- a/.github/workflows/testing-browser.yml +++ b/.github/workflows/testing-browser.yml @@ -13,15 +13,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [16.x] suite: [unit, visual] target: [chrome, firefox] steps: - uses: actions/checkout@v2 - name: Unit tests on Chrome uses: actions/setup-node@v1 - # with: - # node-version: ${{ matrix.node-version }} + with: + node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build -- -f - name: Run headless test From 5abd06d39e592ed94f23d5f19a130fbf4c475a95 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 07:59:12 +0300 Subject: [PATCH 3/9] Update testing-browser.yml --- .github/workflows/testing-browser.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-browser.yml b/.github/workflows/testing-browser.yml index 1d3a31242f8..b003139a9f1 100644 --- a/.github/workflows/testing-browser.yml +++ b/.github/workflows/testing-browser.yml @@ -9,13 +9,13 @@ on: branches: [ master ] jobs: - chrome-tests: + test: runs-on: ubuntu-latest strategy: matrix: node-version: [16.x] - suite: [unit, visual] target: [chrome, firefox] + suite: [unit, visual] steps: - uses: actions/checkout@v2 - name: Unit tests on Chrome From 47177df71ed7aff03ab92d3efa101f9948bd84fe Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:01:09 +0300 Subject: [PATCH 4/9] Update testing-node.yml --- .github/workflows/testing-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index c8de7a69221..b45ff1b9959 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -19,7 +19,7 @@ jobs: suites: [unit, visual] steps: - uses: actions/checkout@v2 - - name: Install `node-canvas` + - name: Install node-canvas - run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 From 78ab6ada71418325c64990b57f4e0ce7afe5aba7 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:06:58 +0300 Subject: [PATCH 5/9] cleanup --- .github/workflows/testing-browser.yml | 5 ++--- .github/workflows/testing-node.yml | 14 ++++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testing-browser.yml b/.github/workflows/testing-browser.yml index b003139a9f1..3a021f9aaed 100644 --- a/.github/workflows/testing-browser.yml +++ b/.github/workflows/testing-browser.yml @@ -1,4 +1,3 @@ -# This workflow will do a clean install of node dependencies, build the library, run testem for chrome name: Browser Unit Tests @@ -24,7 +23,7 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build -- -f - - name: Run headless test + - name: Run ${{ matrix.target }} ${{ matrix.suite }} headless test uses: GabrielBB/xvfb-action@v1 with: - run: npm run test -- -s ${{ matrix.suite }} -c ${{ matrix.target }} + run: npm run test -- -c ${{ matrix.target }} -s ${{ matrix.suite }} diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index b45ff1b9959..253151fe26c 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -1,5 +1,3 @@ -# 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: Node Unit Tests @@ -15,16 +13,20 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: [16.x] suites: [unit, visual] steps: - uses: actions/checkout@v2 - name: Install node-canvas - - run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev + run: sudo apt-get install libgif-dev libpng-dev libpango1.0-dev libjpeg8-dev librsvg2-dev libcairo2-dev - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: npm ci - - run: npm run build -- -f - - run: npm run test -- -s ${{ matrix.suite }} -p 8080 -c node + - name: Build + run: npm run build -- -f + - name: Run ${{ matrix.suite }} tests + run: npm run test -- -c node -s ${{ matrix.suite }} From 340ed33513417baba8fbe93a75da510ad8f18ab7 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:09:29 +0300 Subject: [PATCH 6/9] Update testing-node.yml --- .github/workflows/testing-node.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 253151fe26c..535a60f7bb7 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -8,7 +8,7 @@ on: branches: [ master ] jobs: - node-unit-tests: + test: runs-on: ubuntu-latest strategy: fail-fast: false @@ -16,7 +16,7 @@ jobs: # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ node-version: [16.x] - suites: [unit, visual] + suite: [unit, visual] steps: - uses: actions/checkout@v2 - name: Install node-canvas From c5e1e2dc2fb2871a2a7b9da87b9d0a09cdad9204 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:09:57 +0300 Subject: [PATCH 7/9] Update testing-node.yml --- .github/workflows/testing-node.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 535a60f7bb7..81f43ff8e44 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -13,8 +13,9 @@ jobs: strategy: fail-fast: false matrix: - # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + # For more information see: + # https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + # supported Node.js release schedule: https://nodejs.org/en/about/releases/ node-version: [16.x] suite: [unit, visual] steps: From 712c487d6868cd1a911f4a58ec897ae8d3cbad74 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:23:59 +0300 Subject: [PATCH 8/9] refactor(): consolidate all test workflows --- .github/workflows/testing-browser.yml | 29 ------------------- .../workflows/{testing-node.yml => tests.yml} | 23 +++++++++++++-- 2 files changed, 21 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/testing-browser.yml rename .github/workflows/{testing-node.yml => tests.yml} (61%) diff --git a/.github/workflows/testing-browser.yml b/.github/workflows/testing-browser.yml deleted file mode 100644 index 3a021f9aaed..00000000000 --- a/.github/workflows/testing-browser.yml +++ /dev/null @@ -1,29 +0,0 @@ - -name: Browser Unit Tests - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - target: [chrome, firefox] - suite: [unit, visual] - steps: - - uses: actions/checkout@v2 - - name: Unit tests on Chrome - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build -- -f - - name: Run ${{ matrix.target }} ${{ matrix.suite }} headless test - uses: GabrielBB/xvfb-action@v1 - with: - run: npm run test -- -c ${{ matrix.target }} -s ${{ matrix.suite }} diff --git a/.github/workflows/testing-node.yml b/.github/workflows/tests.yml similarity index 61% rename from .github/workflows/testing-node.yml rename to .github/workflows/tests.yml index 81f43ff8e44..4cd080c93fb 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,5 @@ -name: Node Unit Tests +name: Unit Testing on: push: @@ -8,7 +8,26 @@ on: branches: [ master ] jobs: - test: + browser: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + target: [chrome, firefox] + suite: [unit, visual] + steps: + - uses: actions/checkout@v2 + - name: Unit tests on Chrome + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build -- -f + - name: Run ${{ matrix.target }} ${{ matrix.suite }} headless test + uses: GabrielBB/xvfb-action@v1 + with: + run: npm run test -- -c ${{ matrix.target }} -s ${{ matrix.suite }} + node: runs-on: ubuntu-latest strategy: fail-fast: false From af204a31a1890725b71dccc31d11a124fac8ec22 Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Thu, 1 Sep 2022 08:24:25 +0300 Subject: [PATCH 9/9] version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f4cbaa5d6f..8dfa76f9712 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: - run: npm run build -- -f - run: npm run test:coverage && npm run test:visual:coverage - run: npm run coverage:report - - uses: ShaMan123/lcov-reporter-action@v1.0.6 + - uses: ShaMan123/lcov-reporter-action@v1.1.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} delete-old-comments: true