aboutsummaryrefslogtreecommitdiffstats
path: root/.circleci/config.yml
blob: 9f0a2dcaee51fe339111dd151a9b8c46c6eae339 (plain) (blame)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: 2

jobs:
  checkout_code:
    docker:
      - image: borisfaure/terminology-ci:latest
    steps:
      - run: |
          cd /terminology
          git pull --ff-only
          if [ -n "$CIRCLE_PR_NUMBER" ]; then
              git fetch origin pull/$CIRCLE_PR_NUMBER/head
          fi
          if [ -n "$CIRCLE_SHA1" ]; then
            git reset --hard $CIRCLE_SHA1
          else
            git reset --hard origin/master
          fi
      - save_cache:
          key: checkout-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - /terminology

  build_gcc:
    docker:
      - image: borisfaure/terminology-ci:latest
    steps:
      - restore_cache:
          key: checkout-{{ .Environment.CIRCLE_SHA1 }}
      - run: |
          cd /terminology
          meson -Dtests=true -Dfuzzing=true -Db_coverage=true . build
          meson configure build
          cd build
          ninja
      - save_cache:
          key: build_gcc-{{ .Environment.CIRCLE_SHA1 }}
          paths:
            - /terminology
  tests_gcc:
    docker:
      - image: borisfaure/terminology-ci:latest
    steps:
      - restore_cache:
          key: build_gcc-{{ .Environment.CIRCLE_SHA1 }}
      - run: |
          cd /terminology
          tests/run_tests.sh -v -t build/src/bin/tytest -r tests/tests.results -d tests/
      - run: |
          cd /terminology/build/
          bash <(curl -s https://codecov.io/bash)
  build_clang:
    docker:
      - image: borisfaure/terminology-ci:latest
    environment:
      - CC: clang
    steps:
      - restore_cache:
          key: checkout-{{ .Environment.CIRCLE_SHA1 }}
      - run: |
          cd /terminology
          meson -Dtests=true -Dfuzzing=true . build
          meson configure build
          cd build
          ninja
path: /terminology
workflows:
  version: 2
  build-and-deploy:
    jobs:
      - checkout_code
      - build_gcc:
          requires:
            - checkout_code
      - tests_gcc:
          requires:
            - build_gcc
      - build_clang:
          requires:
            - checkout_code