Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add support for windows runner #133

Closed
wants to merge 131 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
dca42aa
add matrix.os
JeffreyDallas Mar 6, 2024
ca6df4c
save
JeffreyDallas Mar 6, 2024
bb5a72f
save
JeffreyDallas Mar 6, 2024
39f2cf0
save
JeffreyDallas Mar 6, 2024
8bc1b1f
save
JeffreyDallas Mar 6, 2024
044d928
change
JeffreyDallas Mar 6, 2024
44a69d2
save
JeffreyDallas Mar 6, 2024
5a87c7e
save
JeffreyDallas Mar 6, 2024
d3cad52
save
JeffreyDallas Mar 6, 2024
8965560
save
JeffreyDallas Mar 6, 2024
dc9a0ee
save
JeffreyDallas Mar 6, 2024
b3786d2
save
JeffreyDallas Mar 6, 2024
f4fc5d9
test
JeffreyDallas Mar 6, 2024
c326db9
save
JeffreyDallas Mar 6, 2024
b278bc7
save
JeffreyDallas Mar 7, 2024
37a8f84
save
JeffreyDallas Mar 7, 2024
02064cd
save
JeffreyDallas Mar 7, 2024
6f315f8
save
JeffreyDallas Mar 7, 2024
8b76423
save
JeffreyDallas Mar 7, 2024
d46cb0a
save
JeffreyDallas Mar 7, 2024
3113781
save
JeffreyDallas Mar 7, 2024
66c57b3
add
JeffreyDallas Mar 7, 2024
f4a0f50
save
JeffreyDallas Mar 7, 2024
46346de
save
JeffreyDallas Mar 7, 2024
ad87ec1
save
JeffreyDallas Mar 7, 2024
e7f9c31
save
JeffreyDallas Mar 7, 2024
f6a6a19
merge
JeffreyDallas Mar 7, 2024
51da4c6
save
JeffreyDallas Mar 7, 2024
05ceedf
save
JeffreyDallas Mar 7, 2024
4ffe81a
save
JeffreyDallas Mar 8, 2024
77e2d66
save
JeffreyDallas Mar 11, 2024
0a804b4
super
JeffreyDallas Mar 11, 2024
19dd50f
Merge branch 'main' into 00129-solo-windows-runner
JeffreyDallas Mar 11, 2024
650823d
save
JeffreyDallas Mar 11, 2024
0807a59
save
JeffreyDallas Mar 11, 2024
ca15772
save
JeffreyDallas Mar 11, 2024
be302d9
save
JeffreyDallas Mar 11, 2024
e7b3d52
save
JeffreyDallas Mar 11, 2024
6ef5f5b
save
JeffreyDallas Mar 11, 2024
67f3e17
save
JeffreyDallas Mar 11, 2024
3e58e5d
save
JeffreyDallas Mar 11, 2024
f19d0a5
save
JeffreyDallas Mar 11, 2024
a74c418
save
JeffreyDallas Mar 11, 2024
8861f3e
save
JeffreyDallas Mar 11, 2024
45d22a9
save
JeffreyDallas Mar 11, 2024
5858540
save
JeffreyDallas Mar 11, 2024
b1c978f
save
JeffreyDallas Mar 11, 2024
f70d046
save
JeffreyDallas Mar 12, 2024
767f50d
save
JeffreyDallas Mar 12, 2024
5423822
save
JeffreyDallas Mar 12, 2024
d865cc1
save
JeffreyDallas Mar 12, 2024
efed60b
save
JeffreyDallas Mar 12, 2024
2a3e88f
save
JeffreyDallas Mar 12, 2024
3ff2a32
save
JeffreyDallas Mar 12, 2024
6b6d1c3
save
JeffreyDallas Mar 12, 2024
1c929e9
save
JeffreyDallas Mar 12, 2024
b099757
save
JeffreyDallas Mar 12, 2024
cf9b076
save
JeffreyDallas Mar 12, 2024
0803f50
save
JeffreyDallas Mar 12, 2024
7279fa2
save
JeffreyDallas Mar 12, 2024
3d55e7d
save
JeffreyDallas Mar 12, 2024
328e1e9
save
JeffreyDallas Mar 12, 2024
6c3c94c
save
JeffreyDallas Mar 12, 2024
794ab2b
save
JeffreyDallas Mar 12, 2024
3c47da1
save
JeffreyDallas Mar 13, 2024
a370cd6
save
JeffreyDallas Mar 13, 2024
25df780
save
JeffreyDallas Mar 13, 2024
f977adc
save
JeffreyDallas Mar 13, 2024
22ad108
save
JeffreyDallas Mar 13, 2024
2190a2a
save
JeffreyDallas Mar 13, 2024
ff44d56
save
JeffreyDallas Mar 13, 2024
b982f5e
save
JeffreyDallas Mar 13, 2024
0f45d72
save
JeffreyDallas Mar 13, 2024
292f909
save
JeffreyDallas Mar 14, 2024
86c7ffb
save
JeffreyDallas Mar 14, 2024
5497ade
save
JeffreyDallas Mar 14, 2024
1897590
save
JeffreyDallas Mar 14, 2024
6cc4306
save
JeffreyDallas Mar 14, 2024
8bb34c1
save
JeffreyDallas Mar 14, 2024
a6882db
save
JeffreyDallas Mar 14, 2024
3b72955
save
JeffreyDallas Mar 15, 2024
f65743b
save
JeffreyDallas Mar 15, 2024
caf80c5
save
JeffreyDallas Mar 15, 2024
a8654d0
save
JeffreyDallas Mar 15, 2024
f5417bc
save
JeffreyDallas Mar 15, 2024
60110fa
save
JeffreyDallas Mar 18, 2024
21db1dc
save
JeffreyDallas Mar 18, 2024
cc91c75
save
JeffreyDallas Mar 18, 2024
eda9876
save
JeffreyDallas Mar 18, 2024
808e1eb
save
JeffreyDallas Mar 18, 2024
95a45a5
save
JeffreyDallas Mar 18, 2024
8c662e5
save
JeffreyDallas Mar 18, 2024
d429437
save
JeffreyDallas Mar 18, 2024
7c3a784
save
JeffreyDallas Mar 18, 2024
792eb65
save
JeffreyDallas Mar 18, 2024
6658694
save
JeffreyDallas Mar 18, 2024
720cb2f
save
JeffreyDallas Mar 18, 2024
29abb23
save
JeffreyDallas Mar 18, 2024
8adc9a0
save
JeffreyDallas Mar 18, 2024
1f59f31
save
JeffreyDallas Mar 18, 2024
f5b8d1e
save
JeffreyDallas Mar 18, 2024
78daed1
save
JeffreyDallas Mar 19, 2024
292ed8b
save
JeffreyDallas Mar 19, 2024
7419a7b
save
JeffreyDallas Mar 19, 2024
5f67582
save
JeffreyDallas Mar 19, 2024
241c573
save
JeffreyDallas Mar 19, 2024
948b9f0
save
JeffreyDallas Mar 19, 2024
8851d9e
save
JeffreyDallas Mar 19, 2024
081dd8b
save
JeffreyDallas Mar 19, 2024
55cb030
save
JeffreyDallas Mar 19, 2024
12a5133
merge
JeffreyDallas Mar 19, 2024
66a706c
save
JeffreyDallas Mar 19, 2024
93e41d2
save
JeffreyDallas Mar 19, 2024
abcd0b2
save
JeffreyDallas Mar 19, 2024
7f18af8
save
JeffreyDallas Mar 19, 2024
8381613
save
JeffreyDallas Mar 19, 2024
00f573b
save
JeffreyDallas Mar 19, 2024
96bc8f9
save
JeffreyDallas Mar 19, 2024
8113ca7
save
JeffreyDallas Mar 19, 2024
e146685
save
JeffreyDallas Mar 19, 2024
a196532
save
JeffreyDallas Mar 19, 2024
3d72329
save
JeffreyDallas Mar 20, 2024
1bff32a
save
JeffreyDallas Mar 20, 2024
1473eca
save
JeffreyDallas Mar 20, 2024
56dc3e6
save
JeffreyDallas Mar 20, 2024
c37b878
save
JeffreyDallas Mar 20, 2024
1b15a92
Merge branch 'main' into 00129-solo-windows-runner
JeffreyDallas Mar 25, 2024
48a7185
Merge commit 'da0e9779c9ba00aa69b8e32f18719ac8c07418a4' into 00129-so…
JeffreyDallas Mar 26, 2024
34f36cc
save
JeffreyDallas Mar 26, 2024
d918ad1
update flow
JeffreyDallas Mar 28, 2024
3903f91
Merge branch 'main' into 00129-solo-windows-runner
JeffreyDallas Mar 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 129 additions & 14 deletions .github/workflows/zxc-compile-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,122 @@ permissions:
jobs:
compile:
name: ${{ inputs.custom-job-label || 'Compiles' }}
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: solo-windows-2022-large
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Update WSL
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: pwsh
run: |
wsl --update
wsl --install
wsl --set-default-version 2

- name: Set WSL Version 2
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: pwsh
run: |
wsl --status
wsl --update
wsl --list --online
wsl --set-default-version 2
wsl -l -v

- shell: wsl-bash {0}
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
run: |
pwd
ls -ltr
uname -a

- name: Get WSL Info
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: pwsh
run: |
wsl -l -v

- name: WSL Install Helm
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: wsl-bash {0}
run: |

curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get -y install helm
which helm
helm version

- name: WSL Install Kind
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: wsl-bash {0}
run: |
[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
which kind
kind version

- name: WSL Install Docker
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: wsl-bash {0}
run: |

sudo apt-get update
sudo apt-get -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# sudo systemctl start docker
sudo usermod -aG docker $(whoami)

- name: WSL Install NodeJS
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: wsl-bash {0}
run: |
curl -O https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh
./install.sh
nvm install node
node -v
npm -v

- name: WSL Run Docker
if: ${{ runner.os == 'Windows' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
shell: wsl-bash {0}
run: |
echo $USER
ls -l /var/run/docker.sock
stat /var/run/docker.sock
sudo usermod -aG docker $USER
sudo service docker restart
sudo service docker status
sudo docker context ls
sudo ps aux | grep docker
sudo docker version
sudo docker -D run hello-world




- name: Setup Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ inputs.node-version }}
cache: npm


- name: Setup Java
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
Expand All @@ -85,7 +190,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
Expand All @@ -94,6 +199,7 @@ jobs:
verbosity: 3
wait: 120s


- name: Setup Helm
uses: azure/setup-helm@29960d0f5f19214b88e1d9ba750a9914ab0f1a2f # v4.0.0
if: ${{ (inputs.enable-unit-tests || inputs.enable-e2e-tests) && !cancelled() && !failure() }}
Expand All @@ -102,35 +208,44 @@ jobs:

- name: Install Dependencies
id: npm-deps
run: npm ci
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
name: Unit Test Coverage Report - ${{ runner.os }}
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

- name: Setup E2E Tests Linux
if: ${{ inputs.enable-e2e-tests && !cancelled() && !failure() }}
run: |
npm link
Expand All @@ -153,19 +268,19 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@f355d34d53ad4e7f506f699478db2dd71da9de5f # v2.15.1
if: ${{ inputs.enable-e2e-tests && steps.npm-deps.conclusion == 'success' && !cancelled() }}
with:
check_name: 'E2E Test Results'
check_name: 'E2E Test Results - ${{ runner.os }}'
files: "junit-e2e.xml"

- name: Publish E2E Coverage Report
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: ${{ inputs.enable-e2e-tests && !cancelled() }}
with:
name: E2E Coverage Report
name: E2E Coverage Report - ${{ runner.os }}
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() }}
with:
name: Test Reports
name: Test Reports - ${{ runner.os }}
path: "junit*.xml"
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"access": "public"
},
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Unit Tests' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/unit' --testPathIgnorePatterns=\".*/e2e/.*\"",
"test-e2e": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e' --testPathIgnorePatterns=\\\".*/unit/.*\\\"",
"solo": "NODE_OPTIONS=--experimental-vm-modules node solo.mjs",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME=\"Unit Tests\" jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/unit' --testPathIgnorePatterns=\".*/e2e/.*\"",
"test-e2e": "cross-env NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME=\"Jest E2E Tests\" JEST_JUNIT_OUTPUT_NAME=\"junit-e2e.xml\" jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e' --testPathIgnorePatterns=\\\".*/unit/.*\\\"",
"solo": "cross-env NODE_OPTIONS=--experimental-vm-modules node solo.mjs",
"check": "remark . --quiet --frail && eslint .",
"format": "remark . --quiet --frail --output && eslint --fix ."
},
Expand Down Expand Up @@ -66,6 +66,7 @@
"remark-lint-unordered-list-marker-style": "^3.1.2",
"remark-preset-lint-consistent": "^5.1.2",
"remark-preset-lint-recommended": "^6.1.3",
"cross-env": "^7.0.3",
"seedrandom": "^3.0.5"
},
"repository": {
Expand All @@ -74,7 +75,8 @@
},
"os": [
"darwin",
"linux"
"linux",
"win32"
],
"engines": {
"node": ">=18.18.2",
Expand Down
2 changes: 1 addition & 1 deletion src/core/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const CERTIFICATE_VALIDITY_YEARS = 100 // years

export const PUBLIC_PFX = 'public.pfx'

export const OS_WINDOWS = 'windows'
export const OS_WIN32 = 'win32'
export const OS_WINDOWS = 'windows'
export const OS_DARWIN = 'darwin'
export const OS_MAC = 'mac'
export const OS_LINUX = 'linux'
Expand Down
5 changes: 5 additions & 0 deletions src/core/dependency_managers/helm_dependency_manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export class HelmDependencyManager extends ShellRunner {
this.zippy = zippy
this.installationDir = installationDir
this.osPlatform = osPlatform

// Node.js uses 'win32' for windows in package.json os field, but helm uses 'windows'
if (osPlatform === OS_WIN32) {
this.osPlatform = OS_WINDOWS
}
this.osArch = ['x64', 'x86-64'].includes(osArch) ? 'amd64' : osArch
this.helmVersion = helmVersion
this.helmPath = Templates.installationPath(constants.HELM, this.osPlatform, this.installationDir)
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/setup-e2e-windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

SOLO_CLUSTER_NAME=solo-e2e
SOLO_NAMESPACE=solo-e2e
SOLO_CLUSTER_SETUP_NAMESPACE=solo-e2e-cluster
minikube profile list
minikube start -p ${SOLO_CLUSTER_NAME} --driver=docker
solo init --namespace "${SOLO_NAMESPACE}" -i node0,node1,node2 -t v0.42.5 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" || exit 1 # cache args for subsequent commands
solo cluster setup || exit 1
solo network deploy || exit 1
2 changes: 1 addition & 1 deletion test/unit/commands/base.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('BaseCommand', () => {
await expect(baseCmd.run('INVALID_PROGRAM')).rejects.toThrowError()
})
it('should succeed during valid program check', async () => {
await expect(baseCmd.run('date')).resolves.not.toBeNull()
await expect(baseCmd.run('echo')).resolves.not.toBeNull()
})
})
})
Loading