[libxml2] Consolidate CI scripts
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Consolidate CI scripts
- Date: Sun, 4 Sep 2022 21:03:38 +0000 (UTC)
commit 0cc9c1d1b7927de63a93320560f38fefcae5a67d
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Sun Sep 4 15:35:47 2022 +0200
Consolidate CI scripts
.gitlab-ci.yml | 42 ++++++++++--------------------------------
.gitlab-ci/Fetch-W3C-Tests.ps1 | 4 ++++
.gitlab-ci/Install-7-Zip.ps1 | 4 ++++
.gitlab-ci/Setup-MinGW.ps1 | 8 ++++++++
.gitlab-ci/test.sh | 8 ++++++++
5 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 60dc16a0..3155bd2c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,15 +2,12 @@
image: registry.gitlab.gnome.org/gnome/libxml2
variables:
BASE_CONFIG: "--with-ftp --with-legacy --with-xptr-locs"
+ before_script:
+ - rm -rf libxml2-build
+ - mkdir libxml2-build
+ - ln -s /tests/xmlconf libxml2-build
script:
- - |
- rm -rf build
- mkdir build
- cd build
- ln -s /tests/xmlconf
- sh ../autogen.sh $BASE_CONFIG $CONFIG
- make -j$(nproc) V=1 CFLAGS="$CFLAGS -Werror"
- make CFLAGS="$CFLAGS -Werror" check
+ - sh .gitlab-ci/test.sh
gcc:
extends: .test
@@ -113,22 +110,9 @@ cmake:linux:clang:static:
before_script:
- "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
- $Env:Path="C:\msys64\$Env:MINGW_PATH\bin;C:\msys64\usr\bin;$Env:Path"
- - pacman --noconfirm -Syu
- - pacman --noconfirm -S
- ${Env:MINGW_PACKAGE_PREFIX}cmake
- ${Env:MINGW_PACKAGE_PREFIX}libiconv
- ${Env:MINGW_PACKAGE_PREFIX}ninja
- ${Env:MINGW_PACKAGE_PREFIX}python
- ${Env:MINGW_PACKAGE_PREFIX}xz
- ${Env:MINGW_PACKAGE_PREFIX}zlib
- - if (-not (Test-Path 7za.exe)) {
- Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
- cmake -E tar xf 7z1900-extra.7z 7za.exe
- }
- - if (-not (Test-Path libxml2-build/xmlconf)) {
- Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile
xmlts20080827.tar.gz ;
- .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
- }
+ - .gitlab-ci/Setup-MinGW
+ - .gitlab-ci/Install-7-Zip
+ - .gitlab-ci/Fetch-W3C-Tests
script:
- cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install
-DCMAKE_C_FLAGS='-Werror' -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
- cmake --build libxml2-build --target install
@@ -198,14 +182,8 @@ cmake:mingw:w64-x86_64:static:
Expand-Archive cmake-$Env:CMAKE_VERSION-win64-x64.zip -DestinationPath .
}
- $Env:Path="$Env:CI_PROJECT_DIR\cmake-$Env:CMAKE_VERSION-win64-x64\bin;$Env:Path"
- - if (-not (Test-Path 7za.exe)) {
- Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
- cmake -E tar xf 7z1900-extra.7z 7za.exe
- }
- - if (-not (Test-Path libxml2-build/xmlconf)) {
- Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile
xmlts20080827.tar.gz ;
- .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
- }
+ - .gitlab-ci/Install-7-Zip
+ - .gitlab-ci/Fetch-W3C-Tests
script:
- cmake -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install
-DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -S . -B
libxml2-build
- cmake --build libxml2-build --config Debug --target install
diff --git a/.gitlab-ci/Fetch-W3C-Tests.ps1 b/.gitlab-ci/Fetch-W3C-Tests.ps1
new file mode 100644
index 00000000..2d1c35cf
--- /dev/null
+++ b/.gitlab-ci/Fetch-W3C-Tests.ps1
@@ -0,0 +1,4 @@
+if (-not (Test-Path libxml2-build/xmlconf)) {
+ Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz
+ .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+}
diff --git a/.gitlab-ci/Install-7-Zip.ps1 b/.gitlab-ci/Install-7-Zip.ps1
new file mode 100644
index 00000000..ff94ed69
--- /dev/null
+++ b/.gitlab-ci/Install-7-Zip.ps1
@@ -0,0 +1,4 @@
+if (-not (Test-Path 7za.exe)) {
+ Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z
+ cmake -E tar xf 7z1900-extra.7z 7za.exe
+}
diff --git a/.gitlab-ci/Setup-MinGW.ps1 b/.gitlab-ci/Setup-MinGW.ps1
new file mode 100644
index 00000000..ee2452aa
--- /dev/null
+++ b/.gitlab-ci/Setup-MinGW.ps1
@@ -0,0 +1,8 @@
+pacman --noconfirm -Syu
+pacman --noconfirm -S --needed `
+ ${Env:MINGW_PACKAGE_PREFIX}cmake `
+ ${Env:MINGW_PACKAGE_PREFIX}libiconv `
+ ${Env:MINGW_PACKAGE_PREFIX}ninja `
+ ${Env:MINGW_PACKAGE_PREFIX}python `
+ ${Env:MINGW_PACKAGE_PREFIX}xz `
+ ${Env:MINGW_PACKAGE_PREFIX}zlib
diff --git a/.gitlab-ci/test.sh b/.gitlab-ci/test.sh
new file mode 100644
index 00000000..0d8942ff
--- /dev/null
+++ b/.gitlab-ci/test.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+cd libxml2-build
+sh ../autogen.sh $BASE_CONFIG $CONFIG
+make -j$(nproc) V=1 CFLAGS="$CFLAGS -Werror"
+make CFLAGS="$CFLAGS -Werror" check
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]