Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows CI #57

Merged
merged 3 commits into from May 9, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -0,0 +1,103 @@
version: '{build}'

image: Visual Studio 2015

cache:
- sqlite-dll-win32-x86-3240000.zip -> .appveyor.yml
- sqlite-dll-win64-x64-3240000.zip -> .appveyor.yml
- nimbus-deps.zip -> .appveyor.yml
- dlls.zip -> .appveyor.yml
- Nim -> .appveyor.yml

matrix:
# We always want 32 and 64-bit compilation
fast_finish: false

platform:
- x86
- x64

install:
- setlocal EnableExtensions EnableDelayedExpansion

- SET "ROCKSDB_URL=https://github.com/status-im/nimbus-deps/releases/download/nimbus-deps/nimbus-deps.zip"
- SET "ROCKSDB_ARCHIVE=nimbus-deps.zip"
- IF "%PLATFORM%" == "x86" (
SET "SQLITE_URL=https://www.sqlite.org/2018/sqlite-dll-win32-x86-3240000.zip" &
SET "SQLITE_ARCHIVE=sqlite-dll-win32-x86-3240000.zip"
)
- IF "%PLATFORM%" == "x64" (
SET "SQLITE_URL=https://www.sqlite.org/2018/sqlite-dll-win64-x64-3240000.zip" &
SET "SQLITE_ARCHIVE=sqlite-dll-win64-x64-3240000.zip"
)

# use the newest versions documented here: https://www.appveyor.com/docs/windows-images-software/#mingw-msys-cygwin
- IF "%PLATFORM%" == "x86" SET PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;%PATH%
- IF "%PLATFORM%" == "x64" SET PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%

- MKDIR %CD%\bin
- SET PATH=%CD%\bin;%CD%\Nim\bin;%PATH%

# Unpack sqlite
- IF not exist "%SQLITE_ARCHIVE%" appveyor DownloadFile "%SQLITE_URL%" -FileName "%SQLITE_ARCHIVE%"
- 7z x -y "%SQLITE_ARCHIVE%" > nul
- IF "%PLATFORM%" == "x64" ( copy %CD%\sqlite3.dll %CD%\bin\sqlite3_64.dll ) ELSE ( copy %CD%\sqlite3.dll %CD%\bin\sqlite3_32.dll )

# Unpack rocksdb
- IF not exist "%ROCKSDB_ARCHIVE%" appveyor DownloadFile "%ROCKSDB_URL%" -FileName "%ROCKSDB_ARCHIVE%"
- 7z x -y "%ROCKSDB_ARCHIVE%" > nul
- IF "%PLATFORM%" == "x64" ( copy %CD%\x64\librocksdb.dll %CD%\bin\librocksdb.dll ) ELSE ( copy %CD%\x86\librocksdb.dll %CD%\bin\librocksdb.dll )

# unpack other DLLs
- IF not exist "dlls.zip" appveyor DownloadFile "https://nim-lang.org/download/dlls.zip" -FileName "dlls.zip"
- 7z x -y -o%CD%\bin "dlls.zip" > nul

# build nim from our own branch - this to avoid the day-to-day churn and
# regressions of the fast-paced Nim development while maintaining the
# flexibility to apply patches
- SET "NEED_REBUILD="

- IF NOT EXIST "Nim\\.git\\" (
git clone https://github.com/status-im/Nim.git
) ELSE (
( cd Nim ) &
( git pull ) &
( cd .. )
)

# Rebuild Nim if HEAD has moved or if we don't yet have a cached version
- IF NOT EXIST "Nim\\ver.txt" (
SET NEED_REBUILD=1
) ELSE (
( CD Nim ) &
( git rev-parse HEAD > ..\\cur_ver.txt ) &
( fc ver.txt ..\\cur_ver.txt || SET NEED_REBUILD=1 ) &
( cd .. )
)

- IF NOT EXIST "Nim\\bin\\nim.exe" SET NEED_REBUILD=1
- IF NOT EXIST "Nim\\bin\\nimble.exe" SET NEED_REBUILD=1

# after building nim, wipe csources to save on cache space
- IF DEFINED NEED_REBUILD (
cd Nim &
( IF EXIST "csources" rmdir /s /q csources ) &
git clone --depth 1 https://github.com/nim-lang/csources &
cd csources &
( IF "%PLATFORM%" == "x64" ( build64.bat ) else ( build.bat ) ) &
cd .. &
bin\nim c koch &
koch boot -d:release &
koch nimble &
git rev-parse HEAD > ver.txt &
rmdir /s /q csources
)

build_script:
- cd C:\projects\%APPVEYOR_PROJECT_SLUG%
- nimble install -y

test_script:
- nimble test

deploy: off
@@ -2,6 +2,7 @@ nim-chronicles
==============

[![Build Status](https://travis-ci.org/status-im/nim-chronicles.svg?branch=master)](https://travis-ci.org/status-im/nim-chronicles)
[![Build status](https://ci.appveyor.com/api/projects/status/tu9cap72jxdhri9m/branch/master?svg=true)](https://ci.appveyor.com/project/nimbus/nim-chronicles/branch/master)
[![License: Apache](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

@@ -351,7 +351,7 @@ template writeTs(record) =
append(record.output, timestamp(record))

const
propColor = if defined(windows): fgCyan else: fgBlue
propColor = fgBlue
topicsColor = fgYellow

template fgColor(record, color, brightness) =
@@ -2,7 +2,7 @@ program=lexical_scopes
chronicles_sinks="textlines[stdout]"
chronicles_colors=None
chronicles_timestamps=None
max_size=80000
max_size=150000

release
--opt:size
@@ -1,5 +1,5 @@
program=size
max_size=500000
max_size=600000
release

chronicles_sinks="textlines[stdout]"
@@ -1,5 +1,5 @@
program=lexical_scopes
chronicles_sinks="textlines[file(lines.txt,truncate),nocolors],textblocks[file(blocks.txt,truncate),notimestamps]"
chronicles_sinks="textlines[file(lines.txt,truncate),nocolors],textblocks[file(blocks.txt,truncate),notimestamps,ansicolors]"

[Output]
lines.txt="""INF 2018-10-12 12:24:21+02:00 main started topics="main" tid=0 a=10 arg=50 b=inner-b c=10 d=some-d x=16 z=20
@@ -1,5 +1,5 @@
program=multiple_streams
chronicles_streams="foo[textlines[stdout,nocolors]],default[textlines[file,notimestamps]]"
chronicles_streams="foo[textlines[stdout,nocolors]],default[textlines[file,notimestamps,ansicolors]]"

[Output]
stdout="""INF 2018-10-12 21:56:43+02:00 logging to foo tid=0
@@ -197,7 +197,11 @@ proc test(config: TestConfig, testPath: string): TestStatus =
break

result = test.execute()
removeFile(test.program.addFileExt(ExeExt))
try:
# this may fail in 64-bit AppVeyor images with "The process cannot access the file because it is being used by another process. [OSError]"
removeFile(test.program.addFileExt(ExeExt))
except:
echo getCurrentExceptionMsg()

logResult(test.name, result, duration)

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.