Skip to content

Commit d47e837

Browse files
committed
Test windows test
1 parent 26d48a1 commit d47e837

1 file changed

Lines changed: 112 additions & 0 deletions

File tree

.github/workflows/windows.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
name: Foreman Proxy on Windows
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- 'develop'
9+
- '*-stable'
10+
11+
env:
12+
BUNDLE_WITHOUT: "development"
13+
14+
concurrency:
15+
group: ${{ github.ref_name }}-${{ github.workflow }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
bundle-smart-proxy:
20+
runs-on: windows-latest
21+
defaults:
22+
run:
23+
shell: pwsh
24+
strategy:
25+
matrix:
26+
rubyversion: ['3.3', '3.4']
27+
proxytag: ['3.16.1']
28+
29+
steps:
30+
- name: Determine tag to fetch
31+
id: tag
32+
run: |
33+
$ErrorActionPreference = 'Stop'
34+
$repo = 'theforeman/smart-proxy'
35+
36+
if ('${{ github.event.inputs.version }}') {
37+
$tag = '${{ github.event.inputs.version }}'
38+
} else {
39+
$tag = '${{ matrix.proxytag }}'
40+
}
41+
"tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
42+
43+
- name: Setup MSYS2 UCRT64 and krb5
44+
uses: msys2/setup-msys2@v2
45+
with:
46+
update: true
47+
msystem: UCRT64
48+
install: >-
49+
mingw-w64-ucrt-x86_64-toolchain
50+
mingw-w64-ucrt-x86_64-krb5
51+
52+
- name: Install MSYS2 toolchain + Kerberos (ucrt)
53+
shell: pwsh
54+
run: |
55+
ridk install 1 2 3
56+
& 'C:\msys64\usr\bin\bash.exe' -lc "pacman -Sy --noconfirm mingw-w64-ucrt-x86_64-krb5"
57+
58+
- name: Set up Ruby (Windows)
59+
uses: ruby/setup-ruby@v1
60+
with:
61+
ruby-version: ${{ matrix.rubyversion }}
62+
bundler-cache: false
63+
64+
- name: Install Bundler
65+
run: |
66+
gem install bundler --no-document
67+
68+
- name: Print debug info
69+
shell: pwsh
70+
run: |
71+
$repo = 'theforeman/smart-proxy'
72+
$tag = '${{ steps.tag.outputs.tag }}'
73+
$zip = "$env:RUNNER_TEMP\smart-proxy-$tag.zip"
74+
$url = "https://github.com/$repo/archive/refs/tags/$tag.zip"
75+
Write-Host "Repo: $repo"
76+
Write-Host "Tag: $tag"
77+
Write-Host "URL: $url"
78+
Write-Host "ZIP: $zip"
79+
80+
- name: Download release source ZIP
81+
run: |
82+
$repo = 'theforeman/smart-proxy'
83+
$tag = '${{ steps.tag.outputs.tag }}'
84+
$zip = "$env:RUNNER_TEMP\smart-proxy-$tag.zip"
85+
$url = "https://github.com/$repo/archive/refs/tags/$tag.zip"
86+
Invoke-WebRequest -Uri $url -OutFile $zip
87+
Expand-Archive -Path $zip -DestinationPath $env:RUNNER_TEMP -Force
88+
# Move to a stable path
89+
$extracted = Get-ChildItem "$env:RUNNER_TEMP\smart-proxy-*" -Directory | Select-Object -First 1
90+
Move-Item $extracted.FullName "$env:GITHUB_WORKSPACE\smart-proxy"
91+
92+
- name: Show Ruby env (sanity)
93+
working-directory: smart-proxy
94+
run: |
95+
ruby -v
96+
gem -v
97+
ridk version
98+
99+
- name: Bundle install smart-proxy
100+
working-directory: smart-proxy
101+
run: |
102+
# Optional: avoid pulling dev/test groups on CI
103+
bundle config set without 'development test'
104+
# Optional: keep gems in repo-local path
105+
bundle config set path vendor/bundle
106+
bundle install --jobs 4
107+
108+
# Optional: quick smoke (does it parse & list rake tasks?)
109+
- name: Rake sanity
110+
working-directory: smart-proxy
111+
run: |
112+
bundle exec rake -T

0 commit comments

Comments
 (0)