From ce7dbe120e0c7ef3ab65e30142e60c619ab3cb30 Mon Sep 17 00:00:00 2001 From: zvon Date: Wed, 15 Apr 2020 12:31:14 +0200 Subject: [PATCH] Add basic CI --- .gitlab-ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2bcfee5 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,80 @@ +stages: + - build + - test + +linux:build: + image: debian + stage: build + + before_script: + - apt update + - apt install -y libsqlite3-dev libcurl4-openssl-dev g++ make build-essential libgtkmm-3.0-dev gettext + - export CXX=g++ + script: + - make + - make gui + artifacts: + paths: + - tv_rename + - tv_rename_gui + +linux:test: + image: debian + stage: test + needs: ["linux:build"] + + before_script: + - apt update + - apt install -y libcurl4 sqlite3 + script: + - ./tv_rename --help + +formatting:test: + image: debian + stage: test + needs: [] + + before_script: + - apt update + - apt install -y clang-format + script: + - FORMAT="ok" + - while read f ; do clang-format -style=file "$f" > temp.pp ; if [ $(diff temp.pp "$f" | wc -l) -gt 0 ] ; then echo "$f needs reformatting" ; FORMAT="nok" ; fi ; done <<< $(find . -iname "*pp") + - rm temp.pp + - 'if [ "$FORMAT" = "nok" ] ; then exit 1 ; fi' + +windows:build: + tags: + - shared-windows + - windows + - windows-1809 + stage: build + + before_script: + - "$env:LC_ALL='C.UTF-8'" + - "$OutputEncoding = [System.Text.Encoding]::Unicode" + - CHCP 65001 + - mkdir C:\BuildTools + - mkdir C:\TMP + - curl -UseBasicParsing https://aka.ms/vs/16/release/vs_buildtools.exe -o C:\TMP\vs_buildtools.exe + - $returnCode = Start-Process -FilePath C:\TMP\vs_buildtools.exe -ArgumentList "--quiet", "--wait", "--norestart", "--nocache", "--installPath", "C:\BuildTools", "--add", "Microsoft.VisualStudio.Workload.VCTools", "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "--includeRecommended" -Wait -PassThru + - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + - choco install make + script: + - cmd /c 'C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat && set CXX=cl.exe && make windows' + - cmd /c 'C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat && set CXX=cl.exe && make windows_gui' + artifacts: + paths: + - tv_rename.exe + - tv_rename_gui.exe + +windows:test: + tags: + - shared-windows + - windows + - windows-1809 + stage: test + needs: ["windows:build"] + + script: + - .\tv_rename.exe --help