Merge pull request #7965 from dcbaker/wip/2020-11/macos-github-actions

Migrate osx CI from travis to github actions
pull/7973/head
Jussi Pakkanen 4 years ago committed by GitHub
commit 41a79a0757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 86
      .github/workflows/ci_frameworks.yml
  2. 85
      .github/workflows/macos.yml
  3. 10
      .github/workflows/msys2.yml
  4. 5
      .travis.yml
  5. 17
      ci/travis_install.sh
  6. 41
      ci/travis_script.sh
  7. 6
      run_unittests.py
  8. 2
      test cases/common/28 multiline string/meson.build
  9. 3
      test cases/frameworks/8 flex/lexer.l
  10. 5
      test cases/frameworks/8 flex/parser.y
  11. 4
      test cases/rust/2 sharedlib/meson.build
  12. 4
      test cases/rust/4 polyglot/meson.build

@ -1,86 +0,0 @@
name: ci_frameworks
on:
push:
paths:
- "mesonbuild/dependencies/**"
- "test cases/frameworks/**"
- ".github/workflows/ci_frameworks.yml"
pull_request:
paths:
- "mesonbuild/dependencies/**"
- "test cases/frameworks/**"
- ".github/workflows/ci_frameworks.yml"
jobs:
scalapackMacOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python -m pip install -e .
- run: brew install pkg-config ninja gcc openmpi lapack scalapack
- run: meson setup "test cases/frameworks/30 scalapack" build
- run: meson compile -C build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Scalapack_Mac_build
path: build/meson-logs/meson-log.txt
- run: meson test -C build -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Scalapack_Mac_test
path: build/meson-logs/testlog.txt
HDF5macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python -m pip install -e .
- run: brew install pkg-config ninja gcc hdf5
- run: meson setup "test cases/frameworks/25 hdf5" build -Dmethod=config-tool
- run: meson compile -C build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: HDF5_Mac_build
path: build/meson-logs/meson-log.txt
- run: meson test -C build -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: HDF5_Mac_test
path: build/meson-logs/testlog.txt
Qt4macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python -m pip install -e .
- run: brew install pkg-config ninja gcc
- run: brew tap cartr/qt4
- run: brew install qt@4
- run: meson setup "test cases/frameworks/4 qt" build -Drequired=qt4
- run: meson compile -C build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Qt4_Mac_build
path: build/meson-logs/meson-log.txt
- run: meson test -C build -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Qt4_Mac_test
path: build/meson-logs/testlog.txt

@ -0,0 +1,85 @@
name: macos
on:
push:
paths:
- "mesonbuild/**"
- "test cases/**"
- ".github/workflows/macos.yml"
pull_request:
paths:
- "mesonbuild/**"
- "test cases/**"
- ".github/workflows/macos.yml"
jobs:
unittests-appleclang:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-xdist jsonschema
- run: brew install pkg-config ninja llvm qt
- env:
CPPFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
MESON_UNIT_TEST_BACKEND: ninja
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
run: |
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
export PATH="$HOME/tools:/usr/local/opt/qt/bin:$PATH:$(brew --prefix llvm)/bin"
./run_unittests.py
project-tests-appleclang:
runs-on: macos-latest
strategy:
matrix:
unity: ["on", "off"]
steps:
- uses: actions/checkout@v2
# use python3 from homebrew because it is a valid framework, unlike the actions one:
# https://github.com/actions/setup-python/issues/58
- run: brew install pkg-config ninja llvm qt boost ldc hdf5 openmpi lapack scalapack sdl2 python3
- run: |
python3 -m pip install --upgrade setuptools
python3 -m pip install --upgrade pip
python3 -m pip install cython
- env:
CPPFLAGS: "-I/usr/local/include"
LDFLAGS: "-L/usr/local/lib"
MESON_ARGS: --unity=${{ matrix.unity }}
CI: 1
# These cannot evaluate anything, so we cannot set PATH or SDKROOT here
run: |
export SDKROOT="$(xcodebuild -version -sdk macosx Path)"
export PATH="$HOME/tools:/usr/local/opt/qt/bin:$PATH:$(brew --prefix llvm)/bin"
./run_project_tests.py --backend=ninja
Qt4macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python -m pip install -e .
- run: brew install pkg-config ninja gcc
- run: brew tap cartr/qt4
- run: brew install qt@4
- run: meson setup "test cases/frameworks/4 qt" build -Drequired=qt4
- run: meson compile -C build
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Qt4_Mac_build
path: build/meson-logs/meson-log.txt
- run: meson test -C build -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Qt4_Mac_test
path: build/meson-logs/testlog.txt

@ -2,7 +2,15 @@ name: msys2
on:
push:
paths:
- "mesonbuild/**"
- "test cases/**"
- ".github/workflows/msys.yml"
pull_request:
paths:
- "mesonbuild/**"
- "test cases/**"
- ".github/workflows/msys.yml"
jobs:
test:
@ -83,4 +91,4 @@ jobs:
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.NAME }}
path: meson-test-run.*
path: meson-test-run.*

@ -8,7 +8,6 @@ branches:
os:
- linux
- osx
compiler:
- gcc
@ -25,10 +24,6 @@ services:
- docker
matrix:
exclude:
# On OS X gcc is just a wrapper around clang, so don't waste time testing that
- os: osx
compiler: gcc
include:
# Test cross builds separately, they do not use the global compiler
# Also hijack one cross build to test long commandline handling codepath (and avoid overloading Travis)

@ -4,19 +4,6 @@ set -e
msg() { echo -e "\x1b[1;32mINFO: \x1b[37m$*\x1b[0m"; }
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
msg "Running OSX setup"
brew update
# Run one macOS build with pkg-config available (pulled in by qt), and the
# other (unity=on) without pkg-config
brew install qt ldc llvm ninja
if [[ "$MESON_ARGS" =~ .*unity=on.* ]]; then
which pkg-config && rm -f $(which pkg-config)
fi
python3 -m pip install jsonschema
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
msg "Running Linux setup"
docker pull mesonbuild/eoan
fi
msg "Running Linux setup"
docker pull mesonbuild/eoan
msg "Setup finished"

@ -4,16 +4,15 @@ set -e
msg() { echo -e "\x1b[1;32mINFO: \x1b[37m$*\x1b[0m"; }
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# TODO enable coverage
#curl -s https://codecov.io/bash > upload.sh
#chmod +x upload.sh
# TODO enable coverage
#curl -s https://codecov.io/bash > upload.sh
#chmod +x upload.sh
# We need to copy the current checkout inside the Docker container,
# because it has the MR id to be tested checked out.
# We need to copy the current checkout inside the Docker container,
# because it has the MR id to be tested checked out.
msg "Generating runner:"
cat <<EOF | tee run.sh
msg "Generating runner:"
cat <<EOF | tee run.sh
#!/bin/bash
set -e
@ -50,23 +49,9 @@ ADD . /root
EOF
msg "Building the docker image..."
docker build -t test_img .
msg "Start running tests"
#ci_env=`bash <(curl -s https://codecov.io/env)`
docker run --security-opt seccomp:unconfined test_img /root/run.sh
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
# Ensure that llvm is added after $PATH, otherwise the clang from that llvm install will be used instead of the native apple clang.
export SDKROOT=$(xcodebuild -version -sdk macosx Path)
export CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
export OBJC=$CC
export OBJCXX=$CXX
export PATH=$HOME/tools:/usr/local/opt/qt/bin:$PATH:$(brew --prefix llvm)/bin
if test "$MESON_RSP_THRESHOLD" != ""
then
export MESON_RSP_THRESHOLD=$MESON_RSP_THRESHOLD
fi
./run_tests.py $RUN_TESTS_ARGS --backend=ninja -- $MESON_ARGS
fi
msg "Building the docker image..."
docker build -t test_img .
msg "Start running tests"
#ci_env=`bash <(curl -s https://codecov.io/env)`
docker run --security-opt seccomp:unconfined test_img /root/run.sh

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from mesonbuild.compilers.objc import AppleClangObjCCompiler
import time
import stat
import subprocess
@ -7334,6 +7335,11 @@ c = ['{0}']
with mock.patch.dict(os.environ, {envvar: name}):
env = get_fake_env()
comp = getattr(env, 'detect_{}_compiler'.format(lang))(MachineChoice.HOST)
if isinstance(comp, (mesonbuild.compilers.AppleClangCCompiler,
mesonbuild.compilers.AppleClangCPPCompiler,
mesonbuild.compilers.AppleClangObjCCompiler,
mesonbuild.compilers.AppleClangObjCPPCompiler)):
raise unittest.SkipTest('AppleClang is currently only supported with ld64')
if lang != 'rust' and comp.use_linker_args('bfd') == []:
raise unittest.SkipTest(
'Compiler {} does not support using alternative linkers'.format(comp.id))

@ -26,6 +26,8 @@ endif
cc = meson.get_compiler('c')
prog = '''
#include <stdio.h>
int main(void) {
int num = 1;
printf("%d\n", num);

@ -1,6 +1,9 @@
%{
#include <stdlib.h>
#include "parser.tab.h"
extern int yylex(void);
extern int yyerror();
%}
%%

@ -1,3 +1,8 @@
%{
extern int yylex(void);
extern int yyerror();
%}
%token BOOLEAN
%%

@ -1,5 +1,9 @@
project('rust shared library', 'rust')
if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST: doesnt work right on macos, please fix!')
endif
l = shared_library('stuff', 'stuff.rs', install : true)
e = executable('prog', 'prog.rs', link_with : l, install : true)

@ -1,5 +1,9 @@
project('rust and c polyglot executable', 'c', 'rust')
if host_machine.system() == 'darwin'
error('MESON_SKIP_TEST: doesnt work right on macos, please fix!')
endif
l = library('stuff', 'stuff.rs', rust_crate_type: 'cdylib', install : true)
e = executable('prog', 'prog.c', link_with : l, install : true)
test('polyglottest', e)

Loading…
Cancel
Save