|
| 1 | +name: MSBuild |
| 2 | +run-name: psql ODBC CI - ${{ github.event.head_commit.message }} |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ "main" ] |
| 7 | + tags: |
| 8 | + - 'REL-*' |
| 9 | + pull_request: |
| 10 | + branches: [ "main" ] |
| 11 | + |
| 12 | +env: |
| 13 | + # Path to the solution file relative to the root of the project. |
| 14 | + SOLUTION_FILE_PATH: . |
| 15 | + |
| 16 | + # Configuration type to build. |
| 17 | + # You can convert this to a build matrix if you need coverage of multiple configuration types. |
| 18 | + # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 19 | + BUILD_CONFIGURATION: Release |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
| 23 | + |
| 24 | +jobs: |
| 25 | + build_and_test: |
| 26 | + runs-on: windows-latest |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + repository: "postgres/postgres.git" |
| 32 | + ref: 'master' |
| 33 | + - name: 'get meson' |
| 34 | + run: | |
| 35 | + python -m pip install meson |
| 36 | + python -m pip install ninja |
| 37 | + - name: Cache Postgres directory |
| 38 | + uses: actions/cache@v4 |
| 39 | + id: cachePostgres |
| 40 | + with: |
| 41 | + path: d:\postgresql |
| 42 | + key: postgresql |
| 43 | + - name: Cache Postgres86 directory |
| 44 | + uses: actions/cache@v4 |
| 45 | + id: cachePostgres86 |
| 46 | + with: |
| 47 | + path: d:\postgresql86 |
| 48 | + key: postgresql86 |
| 49 | + - name: Cache GNU diffutils for Test on PostgreSQL for Windows |
| 50 | + uses: actions/cache@v4 |
| 51 | + id: cacheDiffutilsZip |
| 52 | + with: |
| 53 | + path: C:\OTHERBIN\diffutils |
| 54 | + key: diffutils-2.8.7-1-bin.zip |
| 55 | + env: |
| 56 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 |
| 57 | + - name: Cache PostgreSQL installer |
| 58 | + uses: actions/cache@v4 |
| 59 | + id: cachePostgresInstaller |
| 60 | + with: |
| 61 | + path: C:\OTHERBIN\postgresql_install.exe |
| 62 | + key: postgresql_installer |
| 63 | + - name: Cache pkgconfiglite for Compile using msvc and meson |
| 64 | + uses: actions/cache@v4 |
| 65 | + id: cachePkgConfigLiteZip |
| 66 | + with: |
| 67 | + path: C:\OTHERBIN\pkgconfiglite |
| 68 | + key: pkg-config-lite-0.28-1_bin-win32.zip |
| 69 | + env: |
| 70 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 |
| 71 | + |
| 72 | + - name: Cache winflexbison for Compile using msvc |
| 73 | + uses: actions/cache@v4 |
| 74 | + id: cacheWinFlexBisonZip |
| 75 | + with: |
| 76 | + path: C:\OTHERBIN\winflexbison |
| 77 | + key: win_flex_bison-2.5.24.zip |
| 78 | + env: |
| 79 | + SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 |
| 80 | + - name: Download GNU diffutils for Test on PostgreSQL for Windows |
| 81 | + if: ${{steps.cacheDiffutilsZip.outputs.cache-hit != 'true'}} |
| 82 | + |
| 83 | + id: downloadDiffutilsZip |
| 84 | + with: |
| 85 | + retry-times: 5 |
| 86 | + url: https://zenlayer.dl.sourceforge.net/project/gnuwin32/diffutils/2.8.7-1/diffutils-2.8.7-1-bin.zip |
| 87 | + |
| 88 | + - name: Download pkgconfiglite for Compile using msvc and meson |
| 89 | + if: ${{steps.cachePkgConfigLiteZip.outputs.cache-hit != 'true'}} |
| 90 | + |
| 91 | + id: downloadPkgConfigLiteZip |
| 92 | + with: |
| 93 | + retry-times: 5 |
| 94 | + url: http://downloads.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip |
| 95 | + |
| 96 | + - name: Download winflexbison for Compile using msvc |
| 97 | + if: ${{steps.cacheWinFlexBisonZip.outputs.cache-hit != 'true'}} |
| 98 | + |
| 99 | + id: downloadWinFlexBisonZip |
| 100 | + with: |
| 101 | + retry-times: 5 |
| 102 | + url: https://sourceforge.net/projects/winflexbison/files/win_flex_bison-2.5.24.zip |
| 103 | + |
| 104 | + - name: Download postgresql install from EDB |
| 105 | + |
| 106 | + if: ${{steps.cachePostgresInstaller.outputs.cache-hit != 'true'}} |
| 107 | + id: downloadPostgresInstaller |
| 108 | + with: |
| 109 | + retry-times: 5 |
| 110 | + url: https://sbp.enterprisedb.com/getfile.jsp?fileid=1258893 |
| 111 | + target: c:\OTHERBIN |
| 112 | + filename: postgresql_install.exe |
| 113 | + |
| 114 | + - name: Extract Diffuntils and add Diffuntils bin directory to the PATH for Test on PostgreSQL for Windows |
| 115 | + shell: cmd |
| 116 | + run: | |
| 117 | + rem MKDIR creates any intermediate directories in the path, if needed. |
| 118 | + mkdir "C:\OTHERBIN\diffutils" |
| 119 | + rem 7z is provided by Github Actions |
| 120 | + 7z x diffutils-2.8.7-1-bin.zip -o"C:\OTHERBIN\diffutils" |
| 121 | + copy diffutils-2.8.7-1-bin.zip "C:\OTHERBIN\diffutils" |
| 122 | + dir "C:\OTHERBIN\diffutils" |
| 123 | + rem - man7.org/linux/man-pages/man1/printf.1.html |
| 124 | + printf "C:\\OTHERBIN\\diffutils\\bin" >> %GITHUB_PATH% |
| 125 | +
|
| 126 | + - name: Extract pkgconfiglite and add pkgconfiglite bin directory to the PATH for Compile using msvc and meson |
| 127 | + shell: cmd |
| 128 | + run: | |
| 129 | + rem MKDIR creates any intermediate directories in the path, if needed. |
| 130 | + mkdir "C:\OTHERBIN\pkgconfiglite" |
| 131 | + rem 7z is provided by Github Actions |
| 132 | + 7z x pkg-config-lite-0.28-1_bin-win32.zip -o"C:\OTHERBIN\pkgconfiglite" |
| 133 | + copy pkg-config-lite-0.28-1_bin-win32.zip "C:\OTHERBIN\pkgconfiglite" |
| 134 | + dir "C:\OTHERBIN\pkgconfiglite" |
| 135 | + rem - man7.org/linux/man-pages/man1/printf.1.html |
| 136 | + printf "C:\\OTHERBIN\\pkgconfiglite\\pkg-config-lite-0.28-1\\bin" >> %GITHUB_PATH% |
| 137 | +
|
| 138 | + # Choco Install winflexbison |
| 139 | + # BUT the "crazy-max/ghaction-chocolatey@v2" "install pkgconfiglite" file download often times-out |
| 140 | + - name: Extract winflexbison and add the winflexbison directory to the PATH for Compile using msvc |
| 141 | + shell: cmd |
| 142 | + run: | |
| 143 | + rem MKDIR creates any intermediate directories in the path, if needed. |
| 144 | + mkdir "C:\OTHERBIN\winflexbison" |
| 145 | + rem 7z is provided by Github Actions |
| 146 | + 7z x win_flex_bison-2.5.24.zip -o"C:\OTHERBIN\winflexbison" |
| 147 | + copy win_flex_bison-2.5.24.zip "C:\OTHERBIN\winflexbison" |
| 148 | + dir "C:\OTHERBIN\winflexbison" |
| 149 | + rem - man7.org/linux/man-pages/man1/printf.1.html |
| 150 | + printf "C:\OTHERBIN\\winflexbison" >> %GITHUB_PATH% |
| 151 | + - name: 'setup msvc x86' |
| 152 | + if: ${{steps.cachePostgres86.outputs.cache-hit != 'true'}} |
| 153 | + uses: TheMrMilchmann/setup-msvc-dev@v3 |
| 154 | + with: |
| 155 | + arch: x86 |
| 156 | + - name: 'build postgresx86' |
| 157 | + if: ${{steps.cachePostgres86.outputs.cache-hit != 'true'}} |
| 158 | + run: | |
| 159 | + meson setup buildx86 --prefix=d:\postgresql86 |
| 160 | + cd buildx86 |
| 161 | + ninja -v |
| 162 | + ninja -v install |
| 163 | + - name: 'setup msvc x64' |
| 164 | + if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}} |
| 165 | + uses: TheMrMilchmann/setup-msvc-dev@v3 |
| 166 | + with: |
| 167 | + arch: x64 |
| 168 | + - name : 'build postgres x64' |
| 169 | + if: ${{steps.cachePostgres.outputs.cache-hit != 'true'}} |
| 170 | + run: | |
| 171 | + meson setup build --prefix=d:\postgresql |
| 172 | + cd build |
| 173 | + ninja |
| 174 | + ninja install |
| 175 | + - name: install postgresql binary |
| 176 | + shell: cmd |
| 177 | + run: | |
| 178 | + echo on |
| 179 | + C:\OTHERBIN\postgresql_install.exe --mode unattended --unattendedmodeui none --superpassword password --enable-components server |
| 180 | + - name: start postgresql |
| 181 | + shell: cmd |
| 182 | + run: | |
| 183 | + echo on |
| 184 | + sc config "postgresql-x64-14" start= auto |
| 185 | + - name: get psqlodbc |
| 186 | + uses: actions/checkout@v4 |
| 187 | + - name: 'setup msvc for psqlodbc' |
| 188 | + uses: TheMrMilchmann/setup-msvc-dev@v3 |
| 189 | + with: |
| 190 | + arch: x86 |
| 191 | + - name: build psqlodbc |
| 192 | + shell: powershell |
| 193 | + run: | |
| 194 | + copy .github\workflows\configuration.xml winbuild |
| 195 | + winbuild\BuildAll.ps1 |
| 196 | + installer\buildInstallers.ps1 |
| 197 | + - name: test psqlodbc |
| 198 | + shell: powershell |
| 199 | + run: | |
| 200 | + winbuild\regress.ps1 -DsnInfo "SERVER=localhost|DATABASE=contrib_regression|PORT=5432|UID=postgres|PWD=password" |
| 201 | + - name: Upload x64 merge module |
| 202 | + uses: actions/upload-artifact@v4 |
| 203 | + with: |
| 204 | + name: psqlODBC x64 Merge Module |
| 205 | + path: ./installer/x64/*.msm |
| 206 | + retention-days: 5 |
| 207 | + if-no-files-found: error |
| 208 | + - name: Upload x64 installer package |
| 209 | + uses: actions/upload-artifact@v4 |
| 210 | + with: |
| 211 | + name: psqlODBC x64 Installer |
| 212 | + path: ./installer/x64/*.msi |
| 213 | + retention-days: 5 |
| 214 | + if-no-files-found: error |
| 215 | + - name: Upload x86 merge module |
| 216 | + uses: actions/upload-artifact@v4 |
| 217 | + with: |
| 218 | + name: psqlODBC x86 Merge Module |
| 219 | + path: ./installer/x86/*.msm |
| 220 | + retention-days: 5 |
| 221 | + if-no-files-found: error |
| 222 | + - name: Upload x86 installer package |
| 223 | + uses: actions/upload-artifact@v4 |
| 224 | + with: |
| 225 | + name: psqlODBC x86 Installer |
| 226 | + path: ./installer/x86/*.msi |
| 227 | + retention-days: 5 |
| 228 | + if-no-files-found: error |
| 229 | + - name: Upload x64 setup |
| 230 | + id: x64_setup |
| 231 | + uses: actions/upload-artifact@v4 |
| 232 | + with: |
| 233 | + name: psqlODBC x64 Setup |
| 234 | + path: ./installer/psqlodbc-setup/bin/Release/psqlodbc-setup.exe |
| 235 | + retention-days: 5 |
| 236 | + if-no-files-found: error |
| 237 | + |
| 238 | + - name: Create Release |
| 239 | + if: startsWith(github.ref, 'refs/tags/REL-') |
| 240 | + |
| 241 | + id: create_release |
| 242 | + with: |
| 243 | + draft: false |
| 244 | + prerelease: false |
| 245 | + token: ${{secrets.RELEASE_TOKEN}} |
| 246 | + artifacts: "./installer/x86/*.msi,./installer/x86/*.msm,./installer/psqlodbc-setup/bin/Release/psqlodbc-setup.exe" |
0 commit comments