diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..fa6d79a --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,50 @@ +version: '{build}' + +image: Visual Studio 2015 + +cache: + - nimbus-deps.zip -> .appveyor.yml + - NimBinaries + +matrix: + # We always want 32 and 64-bit compilation + fast_finish: false + +platform: + - x86 + - x64 + +# when multiple CI builds are queued, the tested commit needs to be in the last X commits cloned with "--depth X" +clone_depth: 10 + +install: + - SET "ROCKSDB_URL=https://github.com/status-im/nimbus-deps/releases/download/nimbus-deps/nimbus-deps.zip" + - SET "ROCKSDB_ARCHIVE=nimbus-deps.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 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 ) + + # 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 + - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_nim.sh + - env MAKE="mingw32-make -j2" ARCH_OVERRIDE=%PLATFORM% bash build_nim.sh Nim csources dist/nimble NimBinaries + +build_script: + - cd C:\projects\%APPVEYOR_PROJECT_SLUG% + - bash -c "nimble install -y" + +test_script: + - nimble test + +deploy: off + diff --git a/.travis.yml b/.travis.yml index 0a80160..d19e3d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,63 +1,44 @@ language: c -cache: ccache +# https://docs.travis-ci.com/user/caching/ +cache: + directories: + - NimBinaries + - rocksdbCache + +git: + # when multiple CI builds are queued, the tested commit needs to be in the last X commits cloned with "--depth X" + depth: 10 matrix: include: - # Build and test against the master (stable) and devel branches of Nim # Build and test using both gcc and clang # For faster testing we don't test clang on linux, only on macOS - os: linux - env: - - CHANNEL=stable - # - CHANNEL=devel compiler: gcc sudo: required - services: - - docker before_install: - # RocksDB is packaged for Ubuntu 16.04+ or Debian Stretch only - # Travis only supports 14.04 at the moment - - docker pull statusteam/nim-base - - ## Travis OSX version is too old and does not have rocksdb + - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" - os: osx - env: CHANNEL=stable compiler: clang - addons: - homebrew: - packages: - - rocksdb - - #allow_failures: - ## Ignore failures when building against the devel Nim branch - ## Also ignore OSX, due to very long build time for Travis - #- env: CHANNEL=devel - #- os: osx - fast_finish: true + before_install: + - launchctl setenv LIBRARY_PATH /usr/local/lib # for RocksDB install: - - if [ $TRAVIS_OS_NAME = osx ]; then - export CHOOSENIM_NO_ANALYTICS=1; - curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh; - sh init.sh -y; - export PATH=~/.nimble/bin:$PATH; - echo "export PATH=~/.nimble/bin:$PATH" >> ~/.profile; - choosenim $CHANNEL; - fi; - - if [ $TRAVIS_OS_NAME = linux ]; then - docker run statusteam/nim-base nim --version; - fi; + # 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 + - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_nim.sh + - env MAKE="make -j2" bash build_nim.sh Nim csources dist/nimble NimBinaries + - export PATH=$PWD/Nim/bin:$PATH + + # build our own rocksdb to test with a fixed version that we think works + - curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_rocksdb.sh + - bash build_rocksdb.sh rocksdbCache script: - - if [ $TRAVIS_OS_NAME = osx ]; then - nimble refresh; - nimble test; - fi; - - if [ $TRAVIS_OS_NAME = linux ]; then - docker run -v "$(pwd):/project" -w /project statusteam/nim-base run "apt-get -qq update && apt-get install -y librocksdb-dev && nimble install -y && nimble test"; - fi; - + - nimble install -y + - nimble test branches: except: