summary refs log tree commit diff stats
path: root/.builds
Commit message (Expand)AuthorAgeFilesLines
* CI openbsd: 3x batching via NIM_TESTAMENT_BATCH ; overall CI finishes in 21m ...Timothee Cour2020-06-303-0/+71
* #12103 - CI for OpenBSD (#12105)Euan2020-04-211-0/+31
* [CI] fix recent freebsd systematic failure (#13788)Timothee Cour2020-03-281-9/+14
* updated builds.sr.ht script according to their email (#13669)Andreas Rumpf2020-03-171-5/+1
* workaround refs #13563 freebsd CI (#13564)Timothee Cour2020-03-021-1/+6
* miscellaneous bug fixes (part 3) (#13304)Timothee Cour2020-02-071-3/+3
* #12103 - CI for FreeBSD (#12179)Euan2019-11-291-0/+31
ref='#n89'>89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
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.14'
        CPU: amd64
      OSX_amd64_cpp:
        vmImage: 'macOS-10.14'
        CPU: amd64
        NIM_COMPILE_TO_CPP: true
      Windows_amd64:
        vmImage: 'windows-2019'
        CPU: amd64
      Windows_amd64_pkg:
        vmImage: 'windows-2019'
        CPU: amd64
        NIM_TEST_PACKAGES: true

  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

    - bash: git clone --depth 1 https://github.com/nim-lang/csources.git
      displayName: 'Checkout csources'

    - task: NodeTool@0
      inputs:
        versionSpec: '8.x'
      displayName: 'Install node.js 8.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, libgcc and libstdc++:
        # - llvm has to be downgraded to have 32bit version installed for sfml.
        # - libgcc and libstdc++ have to be downgraded as an optimization to
        #   prevent the use of the toolchain ppa, which has a terrible download
        #   speed.
        cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
        Package: libllvm6.0 libgcc1 libstdc++6
        Pin: origin "azure.archive.ubuntu.com"
        Pin-Priority: 1001

        Package: *
        Pin: release o=LP-PPA-ubuntu-toolchain-r-test
        Pin-Priority: 100
        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: |
        ncpu=
        case '$(Agent.OS)' in
        'Linux')
          ncpu=$(nproc)
          ;;
        'Darwin')
          ncpu=$(sysctl -n hw.ncpu)
          ;;
        'Windows_NT')
          ncpu=$NUMBER_OF_PROCESSORS
          ;;
        esac
        [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1

        make -C csources -j $ncpu CC=gcc ucpu=$(CPU)
      displayName: 'Build 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)