aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/os_comp.yml
blob: 6d4ed7a94269fd3cfbed1efd52851699ecd958f8 (plain)
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
84
85
86
87
88
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
name: linux

concurrency:
  group: linux-${{ github.head_ref }}
  cancel-in-progress: true

on:
  push:
    branches:
      - master
      # Stable branches such as 0.56 or the eventual 1.0
      - '[0-9]+.[0-9]+'
    paths:
      - "mesonbuild/**"
      - "test cases/**"
      - "unittests/**"
      - ".github/workflows/images.yml"
      - ".github/workflows/os_comp.yml"
      - "run_unittests.py"
  pull_request:
    paths:
      - "mesonbuild/**"
      - "test cases/**"
      - "unittests/**"
      - ".github/workflows/images.yml"
      - ".github/workflows/os_comp.yml"
      - "run_unittests.py"

jobs:
  arch:
    name: ${{ matrix.cfg.name }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        cfg:
          - { name: Arch Linux,       id: arch     }
          - { name: CUDA (on Arch),   id: cuda     }
          - { name: Fedora,           id: fedora   }
          - { name: OpenSUSE,         id: opensuse }
          - { name: Ubuntu Bionic,    id: bionic   }
    container: mesonbuild/${{ matrix.cfg.id }}:latest
    env:
      MESON_CI_JOBNAME: linux-${{ matrix.cfg.id }}-gcc

    steps:
    - uses: actions/checkout@v2
    - name: Run tests
      # All environment variables are stored inside the docker image in /ci/env_vars.sh
      # They are defined in the `env` section in each image.json. CI_ARGS should be set
      # via the `args` array ub the image.json
      run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./tools/run_with_cov.py ./run_tests.py $CI_ARGS'
    - name: Upload coverage report
      run: ./ci/upload_cov.sh "OS Comp [${{ matrix.cfg.name }}]"

  ubuntu-rolling:
    name: 'Ubuntu Rolling'
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        cfg:
          - CC: 'gcc'
            CXX: 'g++'
          - MESON_ARGS: '--unity=on -Ddefault_library=static'
            RUN_TESTS_ARGS: '--no-unittests'
            CC: 'gcc'
            CXX: 'g++'
          - MESON_ARGS: '-Ddefault_library=both'
            RUN_TESTS_ARGS: '--no-unittests'
            CC: 'gcc'
            CXX: 'g++'
          - CC: 'clang'
            CXX: 'clang++'
          - MESON_ARGS: '--unity=on'
            RUN_TESTS_ARGS: '--no-unittests'
            CC: 'clang'
            CXX: 'clang++'
          - RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json'
            MESON_RSP_THRESHOLD: '0'
            CC: 'gcc'
            CXX: 'g++'
          - RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json'
            MESON_ARGS: '--unity=on'
            CC: 'gcc'
            CXX: 'g++'

    env:
      MESON_CI_JOBNAME: linux-${{ github.job }}-${{ matrix.cfg.CC }}

    container:
      image: mesonbuild/ubuntu-rolling
      env:
        MESON_RSP_THRESHOLD: ${{ matrix.cfg.MESON_RSP_THRESHOLD }}
        MESON_ARGS: ${{ matrix.cfg.MESON_ARGS }}
        RUN_TESTS_ARGS: ${{ matrix.cfg.RUN_TESTS_ARGS }}
        CC: ${{ matrix.cfg.CC }}
        CXX: ${{ matrix.cfg.CXX }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Run tests
        shell: bash
        run: |
          export HOME=/root

          export CC=$CC
          export CXX=$CXX
          export OBJC=$CC
          export OBJCXX=$CXX
          export PATH=$(pwd)/tools:$PATH
          if test "$MESON_RSP_THRESHOLD" != ""
          then
            export MESON_RSP_THRESHOLD=$MESON_RSP_THRESHOLD
          fi

          source /ci/env_vars.sh

          update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
          update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
          update-alternatives --set i686-w64-mingw32-gcc   /usr/bin/i686-w64-mingw32-gcc-posix
          update-alternatives --set i686-w64-mingw32-g++   /usr/bin/i686-w64-mingw32-g++-posix

          ./tools/run_with_cov.py ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS

      - name: Upload coverage report
        run: ./ci/upload_cov.sh "Ubuntu [${{ matrix.cfg.CC }} ${{ matrix.cfg.RUN_TESTS_ARGS }} ${{ matrix.cfg.MESON_ARGS }}]"