-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add steps for running unit test on windows platform (#225)
Signed-off-by: Jeffrey Tang <[email protected]> Signed-off-by: Jeffrey Tang <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d1017d8
commit 07f5fe4
Showing
7 changed files
with
79 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,12 @@ permissions: | |
jobs: | ||
compile: | ||
name: ${{ inputs.custom-job-label || 'Compiles' }} | ||
runs-on: [self-hosted, Linux, medium, ephemeral] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- windows-2022 | ||
- [self-hosted, Linux, medium, ephemeral] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
@@ -78,7 +83,7 @@ jobs: | |
|
||
- name: Setup Kind | ||
uses: helm/kind-action@99576bfa6ddf9a8e612d83b513da5a75875caced # v1.9.0 | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
with: | ||
install_only: true | ||
node_image: kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 | ||
|
@@ -92,43 +97,50 @@ jobs: | |
run: npm ci | ||
|
||
- name: Check Code Style | ||
if: ${{ inputs.enable-code-style-check && !cancelled() && !failure() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-code-style-check && !cancelled() && !failure() }} | ||
run: npm run check | ||
|
||
- name: Run Unit Tests | ||
if: ${{ inputs.enable-unit-tests && !cancelled() && !failure() }} | ||
run: npm test | ||
|
||
- name: Publish Unit Test Report | ||
- name: Publish Windows Unit Test Report | ||
uses: EnricoMi/publish-unit-test-result-action/windows/[email protected] | ||
if: ${{ runner.os == 'Windows' && inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
with: | ||
check_name: 'Unit Test Results - ${{ runner.os }}' | ||
files: "junit.xml" | ||
|
||
- name: Publish Linux Unit Test Report | ||
uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1 | ||
if: ${{ inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
with: | ||
check_name: 'Unit Test Results' | ||
check_name: 'Unit Test Results - ${{ runner.os }}' | ||
files: "junit.xml" | ||
|
||
- name: Publish Unit Test Coverage Report | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
if: ${{ inputs.enable-unit-tests && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-unit-tests && !cancelled() }} | ||
with: | ||
name: Unit Test Coverage Report | ||
path: 'coverage/unit' | ||
|
||
- name: Pull Kind Docker Image | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
run: docker image pull kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72 | ||
|
||
- name: Setup E2E Tests | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
run: | | ||
npm link | ||
./test/e2e/setup-e2e.sh | ||
- name: Run E2E Tests | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }} | ||
run: npm run test-e2e | ||
|
||
- name: Upload E2E Logs to GitHub | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() }} | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
with: | ||
name: solo.log | ||
|
@@ -138,21 +150,21 @@ jobs: | |
|
||
- name: Publish E2E Test Report | ||
uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1 | ||
if: ${{ inputs.enable-e2e-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
with: | ||
check_name: 'E2E Test Results' | ||
files: "junit-e2e.xml" | ||
|
||
- name: Publish E2E Coverage Report | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
if: ${{ inputs.enable-e2e-tests && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() }} | ||
with: | ||
name: E2E Coverage Report | ||
path: 'coverage/e2e' | ||
|
||
- name: Publish Test Reports | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | ||
if: ${{ inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
if: ${{ runner.os == 'linux' && inputs.enable-unit-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }} | ||
with: | ||
name: Test Reports | ||
path: "junit*.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters