Skip to content

Commit

Permalink
ci: windows: Merge windows VS and mingw images
Browse files Browse the repository at this point in the history
There's a lot of redundant data in the two images, and the image storage
costs are starting to be noticable; so merge these images.
  • Loading branch information
nbyavuz committed Aug 23, 2023
1 parent 6b1b36c commit 6747f67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 45 deletions.
27 changes: 4 additions & 23 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,7 @@ task:
- env:
PACKERFILE: packer/windows.pkr.hcl
SCRIPTS: scripts/windows*

matrix:
- env:
TASK_NAME: windows-ci-vs-2019
- env:
TASK_NAME: windows-ci-mingw64
TASK_NAME: windows-ci

env:
IMAGE_NAME: ${PREFIX}-${TASK_NAME}
Expand Down Expand Up @@ -377,15 +372,15 @@ task:
task:
name: 'Testing VM Image: ${PREFIX}-${IMAGE_NAME}'
env:
IMAGE_NAME: windows-ci-vs-2019
IMAGE_NAME: windows-ci
depends_on:
- vmbuild-${IMAGE_NAME}
compute_engine_instance:
image_project: $GCP_PROJECT
image: family/${PREFIX}-${IMAGE_NAME}
platform: windows

test_script:
test_vs_script:
- ver
- set
- where perl
Expand All @@ -395,21 +390,7 @@ task:
- bison --version
- flex --version


task:
name: 'Testing VM Image: ${PREFIX}-${IMAGE_NAME}'
env:
IMAGE_NAME: windows-ci-mingw64
depends_on:
- vmbuild-${IMAGE_NAME}
compute_engine_instance:
image_project: $GCP_PROJECT
image: family/${PREFIX}-${IMAGE_NAME}
platform: windows

test_script:
- ver
- set
test_mingw_script:
- C:\msys64\usr\bin\bash.exe -lc 'where perl'
- C:\msys64\usr\bin\bash.exe -lc 'perl --version'
- C:\msys64\usr\bin\bash.exe -lc 'bison --version'
Expand Down
23 changes: 1 addition & 22 deletions packer/windows.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,9 @@ locals {

windows_gcp_images = [
{
task_name = "windows-ci-vs-2019"
},
{
task_name = "windows-ci-mingw64"
},
{
task_name = "windows_ci_vs_2019"
},
{
task_name = "windows_ci_mingw64"
task_name = "windows-ci"
},
]

only = {
vs_2019 = ["googlecompute.windows-ci-vs-2019"],
mingw64 = ["googlecompute.windows-ci-mingw64"],
}
}

source "googlecompute" "windows" {
Expand Down Expand Up @@ -165,13 +151,11 @@ build {
# this could be reduntant
"$env:MSYSTEM = 'UCRT64'",
]
only = local.only.mingw64
}

provisioner "powershell" {
execute_command = var.execute_command
script = "scripts/windows_install_mingw64.ps1"
only = local.only.mingw64
}

# Change default console code page (0) with Windows code page (65001) to get rid of warnings in postgres tests
Expand All @@ -181,7 +165,6 @@ build {
"$ErrorActionPreference = 'Stop'",
"chcp 65001"
]
only = local.only.mingw64
}

# MSYS2 might spawn processes that will stay around in the background forever.
Expand All @@ -192,27 +175,23 @@ build {
"$ErrorActionPreference = 'Stop'",
"taskkill /F /FI \"MODULES eq msys-2.0.dll\""
]
only = local.only.mingw64
}
### end of mingw installations

### vs-2019 installations
provisioner "powershell" {
execute_command = var.execute_command
script = "scripts/windows_install_winflexbison.ps1"
only = local.only.vs_2019
}

provisioner "powershell" {
execute_command = var.execute_command
script = "scripts/windows_install_pg_deps.ps1"
only = local.only.vs_2019
}

provisioner "powershell" {
execute_command = var.execute_command
script = "scripts/windows_install_vs_2019.ps1"
only = local.only.vs_2019
}
### end of vs-2019 installations
}

0 comments on commit 6747f67

Please sign in to comment.