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

wip: Test using custom windows runner #1664

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 44 additions & 24 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,50 @@ 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
shell: "wsl-bash {0}"
os: [self-hosted, Windows, X64, ssbarnea, wsl2]
# shell: "wsl-bash {0}"
shell: "wsl-run {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/setup-wsl@v3.1.3
if: contains(matrix.shell, 'wsl') && false
uses: vedantmgoyal9/setup-wsl2@main
# Vampire/setup-wsl@v3.1.3
with:
distribution: Ubuntu-22.04
set-as-default: "true"
Expand Down Expand Up @@ -154,8 +160,22 @@ jobs:
with:
python-version: "3.12"

- uses: vedantmgoyal9/setup-wsl2@main
- name: wsl setup
run: |
pwd
ls -la
# 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
Loading