Skip to content

Commit 7a269a5

Browse files
test
1 parent e61cb7a commit 7a269a5

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

.github/workflows/ansible.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- 'deployments/ansible/galaxy.yml'
1313
branches:
1414
- main
15+
- ansible-vagrant-checksum
1516
pull_request:
1617
paths:
1718
- '.github/workflows/ansible.yml'
@@ -122,9 +123,31 @@ jobs:
122123
ANSIBLE_FORCE_COLOR: '1'
123124
MOLECULE_DISTRO: ${{ matrix.distro }}
124125

126+
download-vagrant-box:
127+
runs-on: ubuntu-20.04
128+
strategy:
129+
matrix:
130+
distro:
131+
- "2016"
132+
- "2019"
133+
- "2022"
134+
steps:
135+
- uses: actions/checkout@v4
136+
- name: Download vagrant box
137+
run: |
138+
box=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box" ./molecule/config/windows.yml )
139+
box_version=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box_version" ./molecule/config/windows.yml )
140+
json=$( wget -nv -O- https://vagrantcloud.com/api/v2/vagrant/${box} )
141+
url=$( echo "$json" | jq -r ".versions[] | select(.version == \"${box_version}\") | .providers[] | select(.name == \"virtualbox\") | .url" )
142+
wget -nv -O ${GITHUB_WORKSPACE}/vagrant-${{ matrix.distro }}.box $url
143+
- uses: actions/upload-artifact@v4
144+
with:
145+
name: vagrant-box-${{ matrix.distro }}
146+
path: vagrant-${{ matrix.distro }}.box
147+
125148
windows-test:
126149
name: Windows Test
127-
needs: lint
150+
needs: [lint, download-vagrant-box]
128151
runs-on: ubuntu-20.04
129152
timeout-minutes: 60
130153
strategy:
@@ -149,6 +172,11 @@ jobs:
149172
- name: Check out the codebase.
150173
uses: actions/checkout@v4
151174

175+
- uses: actions/download-artifact@v4
176+
with:
177+
name: vagrant-box-${{ matrix.distro }}
178+
path: ${{ github.workspace }}
179+
152180
- name: Install vagrant and virtualbox
153181
run: |
154182
sudo apt update && sudo apt install -y virtualbox
@@ -182,6 +210,7 @@ jobs:
182210
env:
183211
PY_COLORS: '1'
184212
ANSIBLE_FORCE_COLOR: '1'
213+
VAGRANT_BOX_URL: ${{ github.workspace }}/vagrant-${{ matrix.distro }}.box
185214

186215
push-release-tag:
187216
name: Push Release Tag

deployments/ansible/molecule/config/windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ platforms:
1111
- name: "2016"
1212
box: cdaf/WindowsServer
1313
box_version: 2022.09.01
14+
box_url: ${VAGRANT_BOX_URL}
1415
cpus: 2
1516
memory: 4096
1617
provider_options:
@@ -30,6 +31,7 @@ platforms:
3031
- name: "2019"
3132
box: gusztavvargadr/windows-server-2019-standard
3233
box_version: 1809.0.2312
34+
box_url: ${VAGRANT_BOX_URL}
3335
cpus: 2
3436
memory: 4096
3537
provider_options:
@@ -39,6 +41,7 @@ platforms:
3941
- name: "2022"
4042
box: gusztavvargadr/iis-windows-server
4143
box_version: 2102.0.2312
44+
box_url: ${VAGRANT_BOX_URL}
4245
cpus: 2
4346
memory: 4096
4447
provider_options:

0 commit comments

Comments
 (0)