OSDN Git Service

gitlab: drop $CI_PROJECT_DIR from cache path
[qmiga/qemu.git] / .gitlab-ci.d / windows.yml
1 .shared_msys2_builder:
2   extends: .base_job_template
3   tags:
4   - shared-windows
5   - windows
6   - windows-1809
7   cache:
8     key: "${CI_JOB_NAME}-cache"
9     paths:
10       - msys64/var/cache
11   needs: []
12   stage: build
13   timeout: 80m
14   artifacts:
15     name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
16     expire_in: 7 days
17     paths:
18       - build/meson-logs/testlog.txt
19     reports:
20       junit: "build/meson-logs/testlog.junit.xml"
21   before_script:
22   - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)"
23   - If ( !(Test-Path -Path msys64\var\cache ) ) {
24       mkdir msys64\var\cache
25     }
26   - Invoke-WebRequest
27     "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig"
28     -outfile "msys2.exe.sig"
29   - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) {
30       Write-Output "Cached installer sig" ;
31       if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) {
32         Write-Output "Mis-matched installer sig, new installer download required" ;
33         Remove-Item -Path msys64\var\cache\msys2.exe.sig ;
34         if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
35           Remove-Item -Path msys64\var\cache\msys2.exe
36         }
37       } else {
38         Write-Output "Matched installer sig, cached installer still valid"
39       }
40     } else {
41       Write-Output "No cached installer sig, new installer download required" ;
42       if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
43         Remove-Item -Path msys64\var\cache\msys2.exe
44       }
45     }
46   - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) {
47       Write-Output "Fetching latest installer" ;
48       Invoke-WebRequest
49       "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe"
50       -outfile "msys64\var\cache\msys2.exe" ;
51       Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig
52     } else {
53       Write-Output "Using cached installer"
54     }
55   - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)"
56   - msys64\var\cache\msys2.exe -y
57   - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw)
58       -replace '--refresh-keys', '--version') |
59      Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post
60   - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
61   - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu'  # Core update
62   - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu'  # Normal update
63   - taskkill /F /FI "MODULES eq msys-2.0.dll"
64   script:
65   - Write-Output "Installing mingw packages at $(Get-Date -Format u)"
66   - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
67       bison diffutils flex
68       git grep make sed
69       $MINGW_TARGET-capstone
70       $MINGW_TARGET-curl
71       $MINGW_TARGET-cyrus-sasl
72       $MINGW_TARGET-dtc
73       $MINGW_TARGET-gcc
74       $MINGW_TARGET-glib2
75       $MINGW_TARGET-gnutls
76       $MINGW_TARGET-gtk3
77       $MINGW_TARGET-libgcrypt
78       $MINGW_TARGET-libjpeg-turbo
79       $MINGW_TARGET-libnfs
80       $MINGW_TARGET-libpng
81       $MINGW_TARGET-libssh
82       $MINGW_TARGET-libtasn1
83       $MINGW_TARGET-libusb
84       $MINGW_TARGET-lzo2
85       $MINGW_TARGET-nettle
86       $MINGW_TARGET-ninja
87       $MINGW_TARGET-pixman
88       $MINGW_TARGET-pkgconf
89       $MINGW_TARGET-python
90       $MINGW_TARGET-SDL2
91       $MINGW_TARGET-SDL2_image
92       $MINGW_TARGET-snappy
93       $MINGW_TARGET-spice
94       $MINGW_TARGET-usbredir
95       $MINGW_TARGET-zstd "
96   - Write-Output "Running build at $(Get-Date -Format u)"
97   - $env:CHERE_INVOKING = 'yes'  # Preserve the current working directory
98   - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
99   - mkdir build
100   - cd build
101   - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS"
102   - ..\msys64\usr\bin\bash -lc "make"
103   - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;"
104   - Write-Output "Finished build at $(Get-Date -Format u)"
105
106 msys2-64bit:
107   extends: .shared_msys2_builder
108   variables:
109     MINGW_TARGET: mingw-w64-x86_64
110     MSYSTEM: MINGW64
111     # do not remove "--without-default-devices"!
112     # commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices"
113     # changed to compile QEMU with the --without-default-devices switch
114     # for the msys2 64-bit job, due to the build could not complete within
115     CONFIGURE_ARGS:  --target-list=x86_64-softmmu --without-default-devices
116     # qTests don't run successfully with "--without-default-devices",
117     # so let's exclude the qtests from CI for now.
118     TEST_ARGS: --no-suite qtest
119
120 msys2-32bit:
121   extends: .shared_msys2_builder
122   variables:
123     MINGW_TARGET: mingw-w64-i686
124     MSYSTEM: MINGW32
125     CONFIGURE_ARGS:  --target-list=ppc64-softmmu
126     TEST_ARGS: --no-suite qtest