Skip to content

Commit

Permalink
Test using self-hosted windows runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Nov 27, 2024
1 parent 37a7134 commit 6910f45
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 23 deletions.
61 changes: 38 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a basic workflow

# cspell: ignore winget
name: ci

# Controls when the action will run. Triggers the workflow on push or pull request
Expand All @@ -11,6 +11,8 @@ on:
- "v*.*"
pull_request:
branches: ["main", "devel/*"]
pull_request_target:
branches: ["main", "devel/*"]
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
Expand Down Expand Up @@ -67,46 +69,49 @@ jobs:
name:
- docs
include:
- name: lint
task-name: lint
os: ubuntu-22.04
env:
SKIP_PODMAN: 1
SKIP_DOCKER: 1

- name: test (linux)
task-name: test

- name: test (macos)
task-name: test
os: macos-13-large
env:
SKIP_PODMAN: 1
SKIP_DOCKER: 1
# only until we fix some broken tests, as we need it to pass
# in order to enable the caching
continue-on-error: true
# - name: lint
# task-name: lint
# os: ubuntu-22.04
# env:
# SKIP_PODMAN: 1
# SKIP_DOCKER: 1

# - name: test (linux)
# task-name: test

# - name: test (macos)
# task-name: test
# os: macos-13-large
# env:
# SKIP_PODMAN: 1
# SKIP_DOCKER: 1
# # only until we fix some broken tests, as we need it to pass
# # in order to enable the caching
# continue-on-error: true

- name: test (wsl)
# runner does not support running containers
task-name: als:test-without-ee
log-name: als-test-without-ee
# https://github.com/actions/virtual-environments/issues/5151
os: devtools-win-x64
os: [self-hosted, Windows, X64, ssbarnea, wsl2]
shell: "wsl-bash {0}"
env:
SKIP_PODMAN: 1
SKIP_DOCKER: 1
steps:
# Checkout itself might fail on Windows if you did not bootrap the the self-hosted
# runner using the commands from ./tools/setup.ps1
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we need tags for dynamic versioning
show-progress: false

# https://github.com/marketplace/actions/setup-wsl
- name: Activate WSL
if: contains(matrix.shell, 'wsl')
uses: Vampire/[email protected]
if: contains(matrix.shell, 'wsl') && false
uses: vedantmgoyal9/setup-wsl2@main
# Vampire/[email protected]
with:
distribution: Ubuntu-22.04
set-as-default: "true"
Expand Down Expand Up @@ -154,8 +159,18 @@ jobs:
with:
python-version: "3.12"

- name: wsl setup
uses: Ubuntu/WSL/.github/actions/wsl-bash@main
with:
distro: Ubuntu-22.04
# working-dir: /tmp/github/
exec: |
pwd
ls -la
- name: Install asdf inside WSL
if: contains(matrix.shell, 'wsl')
shell: bash
run: |
set -ex
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
Expand Down
11 changes: 11 additions & 0 deletions tools/prepare.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To bootstrap self-hosted Windows runners do this first in
# powershell as administrator:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope AllUsers
Install-Module -Name Microsoft.PowerShell.Archive -MinimumVersion 1.2.5 -Scope AllUsers -SkipPublisherCheck
Install-Module -Name Microsoft.WinGet.Client -Force -Scope AllUsers
Install-Module -Name Git -MinimumVersion 2.42 -Force -Scope AllUsers -SkipPublisherCheck
winget install -e --id Git.Git --accept-source-agreements --accept-package-agreements

# Enable long paths, see https://github.com/actions/checkout/issues/1985
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

0 comments on commit 6910f45

Please sign in to comment.