Skip to content

Commit

Permalink
Windows test
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Hallgren <thomas@tada.se>
  • Loading branch information
thallgren committed Aug 8, 2024
1 parent 58ae922 commit 5ff878a
Showing 1 changed file with 44 additions and 51 deletions.
95 changes: 44 additions & 51 deletions .github/workflows/wtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,51 @@ on:
push:

jobs:
start-cluster:
name: Run Cluster
runs-on: ubuntu-latest
use-docker:
runs-on: windows-latest
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Create Cluster
uses: helm/kind-action@v1
- name: Try once
shell: powershell
run: docker run ubuntu uname -a
continue-on-error: true

- name: Enable WSL
uses: Vampire/setup-wsl@v3
with:
config: kindconfig.yaml
- name: Flatten Kubeconfig
update: true
distribution: Ubuntu-24.04

- name: Install docker daemon
shell: wsl-bash_Ubuntu-24.04 {0}
run: |
kubectl config view --flatten > /tmp/config
cat /tmp/config
- name: Upload Kubeconfig
uses: actions/upload-artifact@v4
with:
name: kubeconfig
path: /tmp/config
- name: Wait for cluster usage to end
uses: lewagon/wait-on-check-action@v1.3.4
with:
ref: ${{ github.ref }}
check-name: Use Cluster
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 20
sudo apt-get update
sudo apt-get 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
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
use-cluster:
name: Use Cluster
runs-on: windows-latest
steps:
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Initial wait
shell: cmd
run: ping -n 40 127.0.0.1 > nul
- name: Download Kubeconfig
uses: Wandalen/wretry.action@master
with:
attempt_limit: 5
attempt_delay: 10000
action: actions/download-artifact@v4
with: |
name: kubeconfig
path: ~/.kube/
- name: Access Cluster
run: kubectl version
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo usermod -aG docker $USER
- name: Restart WSL
shell: powershell
run: |
wsl --shutdown
- name: Install docker daemon
shell: wsl-bash_Ubuntu-24.04 {0}
run: |
sudo service docker start
- name: Try now
run: docker run ubuntu uname -a

0 comments on commit 5ff878a

Please sign in to comment.