Skip to content

Commit e0489fb

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

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

.github/workflows/windows.yml

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

0 commit comments

Comments
 (0)