• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1version: 2
2
3jobs:
4  # the first half of the jobs are in this test
5  short-tests-0:
6    # TODO: Create a small custom docker image with all the dependencies we need
7    #       preinstalled to reduce installation time.
8    docker:
9      - image: fbopensource/zstd-circleci-primary:0.0.1
10    # TODO: Re-enable aarch64 build:
11    #       make aarch64build     && make clean
12    steps:
13      - checkout
14      - run:
15          name: Test
16          command: |
17            ./tests/test-license.py
18            cc -v
19            CFLAGS="-O0 -Werror -pedantic" make allmost; make clean
20            make c99build; make clean
21            make c11build; make clean
22            make -j regressiontest; make clean
23            make shortest; make clean
24            make cxxtest; make clean
25  # the second half of the jobs are in this test
26  short-tests-1:
27    docker:
28      - image: fbopensource/zstd-circleci-primary:0.0.1
29    steps:
30      - checkout
31      - run:
32          name: Test
33          command: |
34            make gnu90build; make clean
35            make gnu99build; make clean
36            make ppc64build V=1; make clean
37            make ppcbuild   V=1; make clean
38            make armbuild   V=1; make clean
39            make -C tests test-legacy test-longmatch; make clean
40            make -C lib libzstd-nomt; make clean
41  # This step should only be run in a cron job
42  regression-test:
43    docker:
44      - image: fbopensource/zstd-circleci-primary:0.0.1
45    environment:
46      CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
47    steps:
48      - checkout
49      # Restore the cached resources.
50      - restore_cache:
51          # We try our best to bust the cache when the data changes by hashing
52          # data.c. If that doesn't work, simply update the version number here
53          # and below. If we fail to bust the cache, the regression testing will
54          # still work, since it has its own stamp, but will need to redownload
55          # everything.
56          keys:
57            - regression-cache-{{ checksum "tests/regression/data.c" }}-v0
58      - run:
59          name: Regression Test
60          command: |
61            make -C programs zstd
62            make -C tests/regression test
63            mkdir -p $CIRCLE_ARTIFACTS
64            ./tests/regression/test                     \
65                --cache  tests/regression/cache         \
66                --output $CIRCLE_ARTIFACTS/results.csv  \
67                --zstd   programs/zstd
68            echo "NOTE: The new results.csv is uploaded as an artifact to this job"
69            echo "      If this fails, go to the Artifacts pane in CircleCI, "
70            echo "      download /tmp/circleci-artifacts/results.csv, and if they "
71            echo "      are still good, copy it into the repo and commit it."
72            echo "> diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv"
73            diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv
74      # Only save the cache on success (default), since if the failure happened
75      # before we stamp the data cache, we will have a bad cache for this key.
76      - save_cache:
77          key: regression-cache-{{ checksum "tests/regression/data.c" }}-v0
78          paths:
79            - tests/regression/cache
80      - store_artifacts:
81          path: /tmp/circleci-artifacts
82
83
84workflows:
85  version: 2
86  commit:
87    jobs:
88      # Run the tests in parallel
89      - short-tests-0
90      - short-tests-1
91      - regression-test
92
93  nightly:
94    triggers:
95      - schedule:
96          cron: "0 0 * * *"
97          filters:
98            branches:
99              only:
100                - release
101                - dev
102                - master
103    jobs:
104      # Run daily regression tests
105      - regression-test
106
107
108
109  # Longer tests
110    #- make -C tests test-zstd-nolegacy && make clean
111    #- pyenv global 3.4.4; make -C tests versionsTest && make clean
112    #- make zlibwrapper         && make clean
113    #- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean
114    #- make uasan               && make clean
115    #- make asan32              && make clean
116    #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu"
117  # Valgrind tests
118    #- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean
119    #- make -C tests valgrindTest && make clean
120  # ARM, AArch64, PowerPC, PowerPC64 tests
121    #- make ppctest             && make clean
122    #- make ppc64test           && make clean
123    #- make armtest             && make clean
124    #- make aarch64test         && make clean
125