forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
59 lines (48 loc) · 1.98 KB
/
.travis.yml
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
# Travis CI integration for p4c using Docker.
branches:
only:
- master
- stable
dist: xenial
language: shell
os:
- linux
- osx
services:
- docker
cache:
directories:
- $HOME/.ccache
env:
- CTEST_PARALLEL_LEVEL=4
UNIFIED=ON
ENABLE_GMP=ON
- CTEST_PARALLEL_LEVEL=4
UNIFIED=OFF
ENABLE_GMP=ON
- CTEST_PARALLEL_LEVEL=4
UNIFIED=ON
ENABLE_GMP=OFF
before_install:
- tools/install_os_deps.sh
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then export PATH="/usr/local/opt/bison/bin:$PATH" ; fi
install:
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then tools/start_ccache; fi
# To flush out issues with unified vs. non-unified builds, do a non-unified
# build before continuing with the rest, which produces a unified build.
# This is done here on MacOS; for Linux, this is done in Dockerfile.
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then docker build --network ccache_network -t p4c --build-arg IMAGE_TYPE=test --build-arg ENABLE_UNIFIED_COMPILATION=$UNIFIED --build-arg ENABLE_GMP=$ENABLE_GMP . ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then ./bootstrap.sh -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_UNIFIED_COMPILATION=$UNIFIED -DENABLE_GMP=$ENABLE_GMP && cd build && make -j2; fi
script:
# run with sudo (...) --privileged so that we can create network namespaces for the ebpf tests
- if [[ $TRAVIS_OS_NAME == 'linux' && $UNIFIED == ON ]] ; then sudo docker run --privileged -w /p4c/build -e CTEST_PARALLEL_LEVEL p4c ctest --output-on-failure --schedule-random ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' && $UNIFIED == ON ]] ; then ctest --output-on-failure -j 2 --schedule-random -LE "bpf$" ; fi
# We run validation in parallel with the normal tests
# Validation ensures that P4C compiles P4-16 programs correctly.
# We only test the front end and some mid end passes for now.
jobs:
include:
- name: "Validation"
os: linux
script:
- docker run -w /gauntlet p4c python3.6 -m pytest test.py -vrf -k "test_p4c" -n $CTEST_PARALLEL_LEVEL --suppress-crashes