summary refs log tree commit diff stats
path: root/.github/workflows/ci_packages.yml
blob: 6cf41aa8e2c99253d71bed469e0dc205044761d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Packages CI
on: [push, pull_request]

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-18.04, macos-10.15]
        cpu: [amd64]
        pkg: [1, 2]
    name: '${{ matrix.os }} (pkg: ${{ matrix.pkg }})'
    runs-on: ${{ matrix.os }}
    env:
      NIM_TEST_PACKAGES: ${{ matrix.pkg }}
    steps:
      - name: 'Checkout'
        uses: actions/checkout@v2
      - name: 'Checkout csources'
        uses: actions/checkout@v2
        with:
          repository: nim-lang/csources
          path: csources

      - name: 'Install node.js 12.x'
        uses: actions/setup-node@v1
        with:
          node-version: '12.x'
      - name: 'Install dependencies (Linux amd64)'
        if: runner.os == 'Linux' && matrix.cpu == 'amd64'
        run: |
          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 libblas-dev
      - name: 'Install dependencies (macOS)'
        if: runner.os == 'macOS'
        run: brew install boehmgc make sfml gtk+3
      - name: 'Install dependencies (Windows)'
        if: runner.os == 'Windows'
        shell: bash
        run: |
          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 "::add-path::${{ github.workspace }}/dist/mingw64/bin"

      - name: 'Add build binaries to PATH'
        shell: bash
        run: echo "::add-path::${{ github.workspace }}/bin"

      - name: 'Build csources'
        shell: bash
        run: |
          ncpu=
          case '${{ runner.os }}' in
          'Linux')
            ncpu=$(nproc)
            ;;
          'macOS')
            ncpu=$(sysctl -n hw.ncpu)
            ;;
          'Windows')
            ncpu=$NUMBER_OF_PROCESSORS
            ;;
          esac
          [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1

          make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.cpu }}'
      - name: 'Build koch'
        shell: bash
        run: nim c koch
      - name: 'Run CI'
        shell: bash
        run: ./koch runCI

      - name: 'Show failed tests'
        if: failure()
        shell: bash
        run: nim c -r tools/ci_testresults.nim