123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- trigger:
- branches:
- include:
- - '*'
- pr:
- branches:
- include:
- - '*'
- jobs:
- - job: packages
- timeoutInMinutes: 90 # default `60` led to lots of cancelled jobs; use 0 for unlimited (may be undesirable)
- strategy:
- matrix:
- Linux_amd64:
- vmImage: 'ubuntu-16.04'
- CPU: amd64
- Linux_i386:
- vmImage: 'ubuntu-16.04'
- CPU: i386
- OSX_amd64:
- vmImage: 'macOS-10.15'
- CPU: amd64
- OSX_amd64_cpp:
- vmImage: 'macOS-10.15'
- CPU: amd64
- NIM_COMPILE_TO_CPP: true
- Windows_amd64_batch0_3:
- vmImage: 'windows-2019'
- CPU: amd64
- # see also: `NIM_TEST_PACKAGES`
- NIM_TESTAMENT_BATCH: "0_3"
- Windows_amd64_batch1_3:
- vmImage: 'windows-2019'
- CPU: amd64
- NIM_TESTAMENT_BATCH: "1_3"
- Windows_amd64_batch2_3:
- vmImage: 'windows-2019'
- CPU: amd64
- NIM_TESTAMENT_BATCH: "2_3"
- pool:
- vmImage: $(vmImage)
- workspace:
- clean: all
- steps:
- - bash: git config --global core.autocrlf false
- displayName: 'Disable auto conversion to CRLF by git (Windows-only)'
- condition: eq(variables['Agent.OS'], 'Windows_NT')
- - checkout: self
- fetchDepth: 1
- - bash: git clone --depth 1 https://github.com/nim-lang/csources
- displayName: 'Checkout Nim csources'
- - task: NodeTool@0
- inputs:
- versionSpec: '12.x'
- displayName: 'Install node.js 12.x'
- - bash: |
- sudo apt-fast update -qq
- DEBIAN_FRONTEND='noninteractive' \
- sudo apt-fast install --no-install-recommends -yq \
- libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
- displayName: 'Install dependencies (amd64 Linux)'
- condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
- - bash: |
- sudo dpkg --add-architecture i386
- # Downgrade llvm:
- # - llvm has to be downgraded to have 32bit version installed for sfml.
- cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
- Package: libllvm6.0
- Pin: origin "azure.archive.ubuntu.com"
- Pin-Priority: 1001
- EOF
- sudo apt-fast update -qq
- # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get:
- # `could not load: libffi.so` during dynamic loading.
- DEBIAN_FRONTEND='noninteractive' \
- sudo apt-fast install --no-install-recommends --allow-downgrades -yq \
- g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \
- libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386
- cat << EOF > bin/gcc
- #!/bin/bash
- exec $(which gcc) -m32 "\$@"
- EOF
- cat << EOF > bin/g++
- #!/bin/bash
- exec $(which g++) -m32 "\$@"
- EOF
- chmod 755 bin/gcc
- chmod 755 bin/g++
- displayName: 'Install dependencies (i386 Linux)'
- condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
- - bash: brew install boehmgc make sfml
- displayName: 'Install dependencies (OSX)'
- condition: eq(variables['Agent.OS'], 'Darwin')
- - bash: |
- mkdir dist
- curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z
- curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
- 7z x dist/mingw64.7z -odist
- 7z x dist/dlls.zip -obin
- echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'
- displayName: 'Install dependencies (Windows)'
- condition: eq(variables['Agent.OS'], 'Windows_NT')
- - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
- displayName: 'Add build binaries to PATH'
- - bash: |
- echo 'PATH:' "$PATH"
- echo '##[section]gcc version'
- gcc -v
- echo '##[section]nodejs version'
- node -v
- echo '##[section]make version'
- make -v
- displayName: 'System information'
- - bash: echo '##vso[task.setvariable variable=csources_version]'"$(git -C csources rev-parse HEAD)"
- displayName: 'Get csources version'
- - task: Cache@2
- inputs:
- key: 'csources | "$(Agent.OS)" | $(CPU) | $(csources_version)'
- path: csources/bin
- displayName: 'Restore built csources'
- - bash: |
- ncpu=
- ext=
- case '$(Agent.OS)' in
- 'Linux')
- ncpu=$(nproc)
- ;;
- 'Darwin')
- ncpu=$(sysctl -n hw.ncpu)
- ;;
- 'Windows_NT')
- ncpu=$NUMBER_OF_PROCESSORS
- ext=.exe
- ;;
- esac
- [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
- if [[ -x csources/bin/nim$ext ]]; then
- echo "Found cached compiler, skipping build"
- else
- make -C csources -j $ncpu CC=gcc ucpu=$(CPU) koch=no
- fi
- cp csources/bin/nim$ext bin
- displayName: 'Build 1-stage compiler from csources'
- - bash: nim c koch
- displayName: 'Build koch'
- # set result to omit the "bash exited with error code '1'" message
- - bash: ./koch runCI || echo '##vso[task.complete result=Failed]'
- displayName: 'Run CI'
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|