From 7501674e02ed787fc96f474ad94bfaf3b832572e Mon Sep 17 00:00:00 2001 From: Will Barnett Date: Mon, 11 Mar 2024 10:13:34 +0000 Subject: [PATCH] Added windows testing edge launcher and github action. --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ package-lock.json | 22 +++++++++++++++- platform/karma.conf.js | 1 + platform/package.json | 1 + 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67dd2e6..fdc61b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,3 +135,58 @@ jobs: - name: Output coverage to summary if: success() || failure() && steps.run-unit-tests.outcome == 'success' run: cat ./platform/reports/SummaryGithub.md >> $GITHUB_STEP_SUMMARY + + + build-win: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup node 18 + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install node dependencies + run: | + npm ci + npm install -g karma-cli + + - name: Build the education platform + id: build-platform + if: success() || failure() + run: npm run build --workspaces + + - name: Run the unit tests + id: run-unit-tests + if: success() || failure() && steps.build-platform.outcome == 'success' + run: npm test --workspaces -- --browsers EdgeHeadless + + - name: Create test report + uses: dorny/test-reporter@v1 + if: success() || failure() && steps.run-unit-tests.outcome == 'success' + with: + name: Unit Test Results - win + path: platform/reports/TESTS*.xml + reporter: java-junit + fail-on-error: true + + - name: Setup .NET Core - for coverage report # Required to execute ReportGenerator + uses: actions/setup-dotnet@v4 + if: success() || failure() && steps.run-unit-tests.outcome == 'success' + with: + dotnet-version: 8.x + dotnet-quality: 'ga' + + - name: Create coverage md report + uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1 + if: success() || failure() && steps.run-unit-tests.outcome == 'success' + with: + reports: ./platform/reports/coverage-report.xml + targetdir: ./platform/reports/ + reporttypes: MarkdownSummaryGithub + + - name: Output coverage to summary + if: success() || failure() && steps.run-unit-tests.outcome == 'success' + run: cat ./platform/reports/SummaryGithub.md >> $GITHUB_STEP_SUMMARY diff --git a/package-lock.json b/package-lock.json index 3023568..b3ced76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5479,6 +5479,15 @@ "node": ">=10.0.0" } }, + "node_modules/karma-edgium-launcher": { + "version": "4.0.0-0", + "resolved": "https://registry.npmjs.org/karma-edgium-launcher/-/karma-edgium-launcher-4.0.0-0.tgz", + "integrity": "sha512-zixTg4O7ogl43t15LKPO03Cns23sXZE0RjwT7oWAWSAgGQo+xERnx7xdPCtCBBGNBrgB2k+1dEVvFym/OA/pdQ==", + "dev": true, + "dependencies": { + "which": "^1.2.1" + } + }, "node_modules/karma-firefox-launcher": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.3.tgz", @@ -7544,6 +7553,7 @@ "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.1", "karma-coverage": "^2.2.1", + "karma-edgium-launcher": "^4.0.0-0", "karma-firefox-launcher": "^2.1.3", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^2.0.0", @@ -11201,6 +11211,15 @@ "minimatch": "^3.0.4" } }, + "karma-edgium-launcher": { + "version": "4.0.0-0", + "resolved": "https://registry.npmjs.org/karma-edgium-launcher/-/karma-edgium-launcher-4.0.0-0.tgz", + "integrity": "sha512-zixTg4O7ogl43t15LKPO03Cns23sXZE0RjwT7oWAWSAgGQo+xERnx7xdPCtCBBGNBrgB2k+1dEVvFym/OA/pdQ==", + "dev": true, + "requires": { + "which": "^1.2.1" + } + }, "karma-firefox-launcher": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-2.1.3.tgz", @@ -11408,11 +11427,12 @@ "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.1", "karma-coverage": "^2.2.1", + "karma-edgium-launcher": "*", "karma-firefox-launcher": "^2.1.3", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^2.0.0", "karma-junit-reporter": "^2.0.1", - "karma-safarinative-launcher": "*", + "karma-safarinative-launcher": "^1.1.0", "karma-webpack": "^5.0.0", "metro4": "^4.5.1", "svg-pan-zoom": "^3.6.1", diff --git a/platform/karma.conf.js b/platform/karma.conf.js index ca75925..c18e8d4 100644 --- a/platform/karma.conf.js +++ b/platform/karma.conf.js @@ -10,6 +10,7 @@ module.exports = function(config) { require('karma-jasmine'), require('karma-chrome-launcher'), require("karma-firefox-launcher"), + require("karma-edgium-launcher"), require("karma-safarinative-launcher"), require('karma-jasmine-html-reporter'), require('karma-junit-reporter') diff --git a/platform/package.json b/platform/package.json index 4ed19df..9be5e3a 100644 --- a/platform/package.json +++ b/platform/package.json @@ -21,6 +21,7 @@ "karma": "^6.4.1", "karma-chrome-launcher": "^3.1.1", "karma-coverage": "^2.2.1", + "karma-edgium-launcher": "^4.0.0-0", "karma-firefox-launcher": "^2.1.3", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^2.0.0",