| 1 |
name: linux |
| 2 |
|
| 3 |
concurrency: |
| 4 |
group: linux-${{ github.head_ref || github.ref }} |
| 5 |
cancel-in-progress: true |
| 6 |
|
| 7 |
on: |
| 8 |
push: |
| 9 |
branches: |
| 10 |
- master |
| 11 |
# Stable branches such as 0.56 or 1.0 |
| 12 |
- '[0-9]+.[0-9]+' |
| 13 |
paths: |
| 14 |
- "mesonbuild/**" |
| 15 |
- "test cases/**" |
| 16 |
- "unittests/**" |
| 17 |
- ".github/workflows/images.yml" |
| 18 |
- ".github/workflows/os_comp.yml" |
| 19 |
- "run*tests.py" |
| 20 |
pull_request: |
| 21 |
paths: |
| 22 |
- "mesonbuild/**" |
| 23 |
- "test cases/**" |
| 24 |
- "unittests/**" |
| 25 |
- ".github/workflows/images.yml" |
| 26 |
- ".github/workflows/os_comp.yml" |
| 27 |
- "run*tests.py" |
| 28 |
|
| 29 |
permissions: |
| 30 |
contents: read |
| 31 |
|
| 32 |
jobs: |
| 33 |
arch: |
| 34 |
name: ${{ matrix.cfg.name }} |
| 35 |
runs-on: ubuntu-latest |
| 36 |
strategy: |
| 37 |
fail-fast: false |
| 38 |
matrix: |
| 39 |
cfg: |
| 40 |
- { name: Arch Linux, id: arch } |
| 41 |
- { name: CUDA (on Arch), id: cuda } |
| 42 |
- { name: Fedora, id: fedora } |
| 43 |
- { name: Gentoo, id: gentoo } |
| 44 |
- { name: OpenSUSE, id: opensuse } |
| 45 |
- { name: Ubuntu Bionic, id: bionic } |
| 46 |
container: |
| 47 |
image: mesonbuild/${{ matrix.cfg.id }}:latest |
| 48 |
volumes: |
| 49 |
- ${{ matrix.cfg.id == 'bionic' && '/node20217:/node20217:rw,rshared' || ' ' }} |
| 50 |
- ${{ matrix.cfg.id == 'bionic' && '/node20217:/__e/node20:ro,rshared' || ' ' }} |
| 51 |
env: |
| 52 |
MESON_CI_JOBNAME: linux-${{ matrix.cfg.id }}-gcc |
| 53 |
|
| 54 |
steps: |
| 55 |
- name: install nodejs20glibc2.17 |
| 56 |
if: ${{ matrix.cfg.id == 'bionic' }} |
| 57 |
run: | |
| 58 |
apt install curl -y |
| 59 |
curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz |
| 60 |
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 |
| 61 |
ldd /__e/node20/bin/node |
| 62 |
- uses: actions/checkout@v4 |
| 63 |
|
| 64 |
- name: Run tests |
| 65 |
# All environment variables are stored inside the docker image in /ci/env_vars.sh |
| 66 |
# They are defined in the `env` section in each image.json. CI_ARGS should be set |
| 67 |
# via the `args` array ub the image.json |
| 68 |
shell: bash |
| 69 |
run: | |
| 70 |
# dmd is installed under /root on OpenSUSE |
| 71 |
[[ ${{ matrix.cfg.id }} == opensuse ]] && export HOME=/root |
| 72 |
|
| 73 |
source /ci/env_vars.sh |
| 74 |
cd $GITHUB_WORKSPACE |
| 75 |
./run_tests.py $CI_ARGS |
| 76 |
|
| 77 |
pypy: |
| 78 |
name: 'Arch / PyPy' |
| 79 |
runs-on: ubuntu-latest |
| 80 |
container: mesonbuild/arch:latest |
| 81 |
env: |
| 82 |
MESON_CI_JOBNAME_UPDATE: linux-arch-gcc-pypy |
| 83 |
|
| 84 |
steps: |
| 85 |
- uses: actions/checkout@v4 |
| 86 |
- name: Run tests |
| 87 |
run: | |
| 88 |
source /ci/env_vars.sh |
| 89 |
export MESON_CI_JOBNAME=$MESON_CI_JOBNAME_UPDATE |
| 90 |
pypy3 run_tests.py |
| 91 |
|
| 92 |
ubuntu-rolling: |
| 93 |
name: 'Ubuntu Rolling' |
| 94 |
runs-on: ubuntu-latest |
| 95 |
|
| 96 |
strategy: |
| 97 |
fail-fast: false |
| 98 |
matrix: |
| 99 |
cfg: |
| 100 |
- CC: 'gcc' |
| 101 |
CXX: 'g++' |
| 102 |
- MESON_ARGS: '--unity=on -Ddefault_library=static' |
| 103 |
RUN_TESTS_ARGS: '--no-unittests' |
| 104 |
CC: 'gcc' |
| 105 |
CXX: 'g++' |
| 106 |
- MESON_ARGS: '-Ddefault_library=both' |
| 107 |
RUN_TESTS_ARGS: '--no-unittests' |
| 108 |
CC: 'gcc' |
| 109 |
CXX: 'g++' |
| 110 |
- CC: 'clang' |
| 111 |
CXX: 'clang++' |
| 112 |
- MESON_ARGS: '--unity=on' |
| 113 |
RUN_TESTS_ARGS: '--no-unittests' |
| 114 |
CC: 'clang' |
| 115 |
CXX: 'clang++' |
| 116 |
- RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json' |
| 117 |
MESON_RSP_THRESHOLD: '0' |
| 118 |
CC: 'gcc' |
| 119 |
CXX: 'g++' |
| 120 |
- RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json' |
| 121 |
MESON_ARGS: '--unity=on' |
| 122 |
CC: 'gcc' |
| 123 |
CXX: 'g++' |
| 124 |
|
| 125 |
env: |
| 126 |
MESON_CI_JOBNAME_UPDATE: linux-${{ github.job }}-${{ matrix.cfg.CC }} |
| 127 |
|
| 128 |
container: |
| 129 |
image: mesonbuild/ubuntu-rolling |
| 130 |
env: |
| 131 |
MESON_RSP_THRESHOLD: ${{ matrix.cfg.MESON_RSP_THRESHOLD }} |
| 132 |
MESON_ARGS: ${{ matrix.cfg.MESON_ARGS }} |
| 133 |
RUN_TESTS_ARGS: ${{ matrix.cfg.RUN_TESTS_ARGS }} |
| 134 |
CC: ${{ matrix.cfg.CC }} |
| 135 |
CXX: ${{ matrix.cfg.CXX }} |
| 136 |
|
| 137 |
steps: |
| 138 |
- name: Checkout code |
| 139 |
uses: actions/checkout@v4 |
| 140 |
|
| 141 |
- name: Run tests |
| 142 |
shell: bash |
| 143 |
run: | |
| 144 |
export HOME=/root |
| 145 |
|
| 146 |
export CC=$CC |
| 147 |
export CXX=$CXX |
| 148 |
export OBJC=$CC |
| 149 |
export OBJCXX=$CXX |
| 150 |
export PATH=$(pwd)/tools:$PATH |
| 151 |
if test "$MESON_RSP_THRESHOLD" != "" |
| 152 |
then |
| 153 |
export MESON_RSP_THRESHOLD=$MESON_RSP_THRESHOLD |
| 154 |
fi |
| 155 |
|
| 156 |
source /ci/env_vars.sh |
| 157 |
export MESON_CI_JOBNAME=$MESON_CI_JOBNAME_UPDATE |
| 158 |
|
| 159 |
update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix |
| 160 |
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix |
| 161 |
update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix |
| 162 |
update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix |
| 163 |
|
| 164 |
./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS |