.gitlab-ci.yml 3.99 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: 5 hrs
34 35
    script:
        - cd test
Martin Jeřábek's avatar
Martin Jeřábek committed
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`"

Martin Jeřábek's avatar
Martin Jeřábek committed
52 53
build_doc:
    stage: build
54
    only: *only
Martin Jeřábek's avatar
Martin Jeřábek committed
55
    image: registry.gitlab.com/canfd/server-tools/lyx
Martin Jeřábek's avatar
Martin Jeřábek committed
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
Martin Jeřábek's avatar
Martin Jeřábek committed
59
        - make -C doc/core
60
        - make -C doc/driver
Martin Jeřábek's avatar
Martin Jeřábek committed
61 62 63
    artifacts:
        paths:
            - doc/core/Progdokum.pdf
64
            - doc/core/ctu_can_fd_architecture.pdf
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
65
            - doc/driver/build
Martin Jeřábek's avatar
Martin Jeřábek committed
66

Martin Jeřábek's avatar
Martin Jeřábek committed
67 68 69
build_linux_driver:
    stage: build
    only: *only
70
    image: registry.gitlab.com/canfd/server-tools/ctucanfd_drvtest
Martin Jeřábek's avatar
Martin Jeřábek committed
71 72 73
    script:
        - cd driver/linux
        - "make -j`nproc` KDIR=/linux/build"
74
        - "make checkpatch KDIR=/linux/build"
75 76 77
    artifacts:
        paths:
            - driver/linux/ctucanfd.ko
Martin Jeřábek's avatar
Martin Jeřábek committed
78

79
test_ip_fast:
80
    stage: test
81
    only: *only
82
    dependencies: [build_ip_and_tests]
83
    script:
84
        - cd test
85
        - make test_debug
Martin Jeřábek's avatar
Martin Jeřábek committed
86
    artifacts:
87
        when: always
Martin Jeřábek's avatar
Martin Jeřábek committed
88
        paths:
89
            - test/tests_fast.xml
90
            - test/xunit.xsl
91 92
        reports:
            junit: [test/tests_fast.xml]
93

94
test_ip_nightly:
95
    stage: test
96
    dependencies: [build_ip_and_tests]
97 98 99 100
    only:
        - schedules
    script:
        - cd test
101
        - make test_debug
102 103
    after_script:
        - cd test
104 105 106 107
        - make coverage
        - make functional_coverage
        - cd ../scripts
        - ./gen_vrm
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
108
    coverage: "/lines......: ([^%]+%)/"
109 110 111 112
    artifacts:
        when: always
        paths:
            - test/code_html
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
113
            - test/tests_nightly.xml
114 115 116 117
            - test/xunit.xsl
            - test/build/functional_coverage
            - scripts/VRM.html
        reports:
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
118 119 120 121 122 123
            junit: [test/tests_nightly.xml]

    # Nightly tests might fail due to randomization. It is not preffered to
    # kill whole follow-up coverage processing due to this failure!
    # Fast pipeline on the other hand can't fail because it must pass before merge!
    allow_failure: true
124

125 126 127 128 129 130
pages:
    stage: deploy
    when: always
    #dependencies: [test_ip_unit, test_ip_sanity]
    script:
        - mkdir -p public
131
        - cp test/xunit.xsl public/
Martin Jeřábek's avatar
Martin Jeřábek committed
132
        - cp test/tests_*.xml public/
133
        - mv test/code_html public/coverage || true
Martin Jeřábek's avatar
Martin Jeřábek committed
134
        - cp doc/core/Progdokum.pdf public/ || true
135
        - cp doc/core/ctu_can_fd_architecture.pdf public/ || true
136
        - cp -R doc/driver/build public/driver_doc || true
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
137
        - mkdir public/functional_coverage
Ille, Ondrej, Ing.'s avatar
Ille, Ondrej, Ing. committed
138
        - cp -R test/build/functional_coverage/* public/functional_coverage || true
139
        - cp scripts/VRM.html public/ || true
140 141
    only:
        - master
142 143 144
    artifacts:
        paths:
            - public
145 146 147

variables:
    GIT_SUBMODULE_STRATEGY: recursive