.gitlab-ci.yml 3.32 KB
Newer Older
1
image: registry.gitlab.com/canfd/server-tools/ghdl
2
before_script:
3
    - "export PATH=/opt/ghdl/bin:$PATH"
Martin Jeřábek's avatar
Martin Jeřábek committed
4 5
    - export LC_ALL=C.UTF-8
    - export LANG=C.UTF-8
6
    - export PYTHONUNBUFFERED=1
7

8 9 10 11 12 13 14 15 16 17
stages:
    - precheck
    - build
    - test
    - deploy

check_component:
    stage: precheck
    script:
        - scripts/gen_vivado_component.py
18 19
        - cd scripts && ./update_reg_map
        - git diff --exit-code || (echo "Vivado component file or register map products are not up-to-date. Either run scripts/gen_vivado_component.py and scripts/update_reg_map or download the files from this job's artifacts."; exit 1)
20 21 22 23
    artifacts:
        expire_in: 1 week
        paths:
            - src/component.xml
24 25 26
            - doc/core/registerMap.lyx
            - driver/ctu_can_fd_regs.h
            - src/lib/can_fd_register_map.vhd
27

28 29
build_ip_and_tests:
    stage: build
30 31
    artifacts:
        paths: &vunit_build_paths
32
            - test/build
33
        expire_in: 1 hour
34 35
    script:
        - cd test
36
        - make elaborate
37 38
        # Do not include the huge binaries in artifacts.
        - rm -R build/vunit_out/test_output
39 40 41 42 43
    only: &only
        - master     # Run on all changes to master branch
        - tags       # Run on all tags
        - triggers   # Run by trigger (on merge request)
        - web        # Run by manual request from web UI
44

45
build_driver:
46
    stage: build
47
    only: *only
48 49 50 51
    script:
        - cd driver
        - "make -j`nproc`"

52 53
build_doc:
    stage: build
54
    only: *only
55
    image: registry.gitlab.com/canfd/server-tools/lyx
56
    script:
Martin Jeřábek's avatar
Martin Jeřábek committed
57 58
        - export LC_ALL=en_US.UTF-8
        - export LANG=en_US.UTF-8
59 60 61 62 63
        - make -C doc/core
    artifacts:
        paths:
            - doc/core/Progdokum.pdf

64 65 66
build_linux_driver:
    stage: build
    only: *only
67
    image: registry.gitlab.com/canfd/server-tools/ctucanfd_drvtest
68 69 70
    script:
        - cd driver/linux
        - "make -j`nproc` KDIR=/linux/build"
71 72 73
    artifacts:
        paths:
            - driver/linux/ctucanfd.ko
74

75
test_ip_fast:
76
    stage: test
77
    only: *only
78
    dependencies: [build_ip_and_tests]
79
    script:
80
        - cd test
81
        - make test_fast
82
        - make coverage
83
        - make functional_coverage
84 85
    coverage: "/lines......: ([^%]+%)/"
    artifacts:
86
        when: always
87
        paths:
Martin Jeřábek's avatar
Martin Jeřábek committed
88
            - test/code_html
89
            - test/tests_fast.xml
90
            - test/xunit.xsl
91
            - test/build/functional_coverage
92 93
        reports:
            junit: [test/tests_fast.xml]
94

95
test_ip_nightly:
96
    stage: test
97
    dependencies: [build_ip_and_tests]
98 99 100 101
    only:
        - schedules
    script:
        - cd test
102
        - make test_nightly
103
    artifacts:
104
        when: always
105
        paths:
Martin Jeřábek's avatar
Martin Jeřábek committed
106
            - test/tests_nightly.xml
107
            - test/xunit.xsl
108 109
        reports:
            junit: [test/tests_nightly.xml]
110 111 112 113 114 115 116

pages:
    stage: deploy
    when: always
    #dependencies: [test_ip_unit, test_ip_sanity]
    script:
        - mkdir -p public
117
        - cp test/xunit.xsl public/
Martin Jeřábek's avatar
Martin Jeřábek committed
118
        - cp test/tests_*.xml public/
119
        - mv test/code_html public/coverage || true
120
        - cp doc/core/Progdokum.pdf public/ || true
121
        - mkdir public/functional_coverage
122
        - cp -R test/build/functional_coverage/* public/functional_coverage || true
123 124
    only:
        - master
125 126 127
    artifacts:
        paths:
            - public
128 129 130

variables:
    GIT_SUBMODULE_STRATEGY: recursive