.gitlab-ci.yml 1.74 KB
Newer Older
1
image: mjerabek/ghdl
2
before_script:
3
    - "export PATH=/opt/ghdl/bin:$PATH"
4 5 6

build_ip_and_tests:
    stage: build
7 8
    artifacts:
        paths: &vunit_build_paths
Martin Jeřábek's avatar
Martin Jeřábek committed
9 10 11
            - test/vunit_out
            - 'test/*.gcda'
            - 'test/*.gcno'
12
        expire_in: 1 hour
13 14
    script:
        - cd test
Martin Jeřábek's avatar
Martin Jeřábek committed
15
        - make elaborate
16 17 18 19 20 21
    only: &only
        - master     # Run on all changes to master branch
        - tags       # Run on all tags
        - schedules  # Run on schedule
        - triggers   # Run by trigger (on merge request)
        - web        # Run by manual request from web UI
22

Martin Jeřábek's avatar
Martin Jeřábek committed
23
.build_driver:
24 25
    stage: build
    allow_failure: true
26
    only: *only
27 28 29 30
    script:
        - cd driver
        - "make -j`nproc`"

31
test_ip_unit:
32
    stage: test
33
    only: *only
34 35 36
    dependencies: [build_ip_and_tests]
    artifacts:
        paths: *vunit_build_paths
37
    script:
38
        - cd test
39
        - make test_unit XUNIT=1
Martin Jeřábek's avatar
Martin Jeřábek committed
40 41 42 43
        - make coverage
    coverage: "/lines......: ([^%]+%)/"
    artifacts:
        paths:
Martin Jeřábek's avatar
Martin Jeřábek committed
44 45
            - test/code_html
            - test/test_unit.xml
46
            - test/xunit.xsl
47 48 49

test_ip_sanity:
    stage: test
50 51 52
    dependencies: [build_ip_and_tests]
    artifacts:
        paths: *vunit_build_paths
53 54 55 56 57 58 59
    only:
        - schedules
    script:
        - cd test
        - make test_sanity XUNIT=1
    artifacts:
        paths:
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
            - test/test_sanity.xml
            - test/xunit.xsl

pages:
    stage: deploy
    when: always
    #dependencies: [test_ip_unit, test_ip_sanity]
    allow_failure: true # for debugging
    script:
        - mkdir -p public
        - cp xunit.xsl public/
        - cp test_*.xml public/
        - mv code_html public/coverage || true
    only:
        - master
    artifacts:
        paths:
            - public