blob: bcf2e1d5ea2a660f46868add9911d210600d3386 [file] [log] [blame]
W. Felix Handte9deef2c2018-08-08 10:28:22 -07001version: 2
Nick Terrell3ff60402018-09-25 16:10:17 -07002
W. Felix Handte9deef2c2018-08-08 10:28:22 -07003jobs:
Nick Terrell3ff60402018-09-25 16:10:17 -07004 # 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:
Ephraim Park3e9572b2019-06-04 11:04:51 -07009 - image: fbopensource/zstd-circleci-primary:0.0.1
Nick Terrell3ff60402018-09-25 16:10:17 -070010 steps:
11 - checkout
Nick Terrell3ff60402018-09-25 16:10:17 -070012 - run:
13 name: Test
14 command: |
Nick Terrellc7ae28a2020-03-26 17:04:52 -070015 ./tests/test-license.py
W. Felix Handte6528fa02020-05-01 12:26:20 -040016 cc -v; CFLAGS="-O0 -Werror -pedantic" make all && make clean
Nick Terrell3ff60402018-09-25 16:10:17 -070017 make c99build ; make clean
18 make c11build ; make clean
19 make aarch64build ; make clean
20 make -j regressiontest; make clean
21 make shortest ; make clean
22 make cxxtest ; make clean
23 # the second half of the jobs are in this test
24 short-tests-1:
25 docker:
Ephraim Park3e9572b2019-06-04 11:04:51 -070026 - image: fbopensource/zstd-circleci-primary:0.0.1
Nick Terrell3ff60402018-09-25 16:10:17 -070027 steps:
28 - checkout
Nick Terrell3ff60402018-09-25 16:10:17 -070029 - run:
30 name: Test
31 command: |
32 make gnu90build; make clean
33 make gnu99build; make clean
34 make ppc64build; make clean
35 make ppcbuild ; make clean
36 make armbuild ; make clean
Bimba Shrestha6a4258a2020-02-05 16:55:00 -080037 make -C tests test-legacy test-longmatch; make clean
Nick Terrell3ff60402018-09-25 16:10:17 -070038 make -C lib libzstd-nomt; make clean
39 # This step is only run on release tags.
40 # It publishes the source tarball as artifacts and if the GITHUB_TOKEN
41 # environment variable is set it will publish the source tarball to the
42 # tagged release.
43 publish-github-release:
44 docker:
Ephraim Park3e9572b2019-06-04 11:04:51 -070045 - image: fbopensource/zstd-circleci-primary:0.0.1
W. Felix Handte9deef2c2018-08-08 10:28:22 -070046 environment:
47 CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
W. Felix Handte9deef2c2018-08-08 10:28:22 -070048 steps:
Nick Terrell3ff60402018-09-25 16:10:17 -070049 - checkout
Nick Terrell3ff60402018-09-25 16:10:17 -070050 - run:
51 name: Publish
52 command: |
53 export VERSION=$(echo $CIRCLE_TAG | tail -c +2)
54 export ZSTD_VERSION=zstd-$VERSION
55 git archive $CIRCLE_TAG --prefix $ZSTD_VERSION/ --format tar \
56 -o $ZSTD_VERSION.tar
Nick Terrell191e19a2018-10-26 13:06:53 -070057 sha256sum $ZSTD_VERSION.tar > $ZSTD_VERSION.tar.sha256
58 zstd -19 $ZSTD_VERSION.tar
59 sha256sum $ZSTD_VERSION.tar.zst > $ZSTD_VERSION.tar.zst.sha256
60 gzip -k -9 $ZSTD_VERSION.tar
61 sha256sum $ZSTD_VERSION.tar.gz > $ZSTD_VERSION.tar.gz.sha256
Nick Terrell3ff60402018-09-25 16:10:17 -070062 mkdir -p $CIRCLE_ARTIFACTS
Nick Terrell191e19a2018-10-26 13:06:53 -070063 cp $ZSTD_VERSION.tar* $CIRCLE_ARTIFACTS
Nick Terrell3ff60402018-09-25 16:10:17 -070064 - store_artifacts:
65 path: /tmp/circleci-artifacts
Nick Terrell4aaa36f2018-11-20 12:37:43 -080066 # This step should only be run in a cron job
67 regression-test:
68 docker:
Ephraim Park3e9572b2019-06-04 11:04:51 -070069 - image: fbopensource/zstd-circleci-primary:0.0.1
Nick Terrell4aaa36f2018-11-20 12:37:43 -080070 environment:
71 CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
72 steps:
73 - checkout
Nick Terrell4aaa36f2018-11-20 12:37:43 -080074 # Restore the cached resources.
75 - restore_cache:
76 # We try our best to bust the cache when the data changes by hashing
77 # data.c. If that doesn't work, simply update the version number here
78 # and below. If we fail to bust the cache, the regression testing will
79 # still work, since it has its own stamp, but will need to redownload
80 # everything.
81 keys:
82 - regression-cache-{{ checksum "tests/regression/data.c" }}-v0
83 - run:
84 name: Regression Test
85 command: |
86 make -C programs zstd
87 make -C tests/regression test
88 mkdir -p $CIRCLE_ARTIFACTS
89 ./tests/regression/test \
90 --cache tests/regression/cache \
91 --output $CIRCLE_ARTIFACTS/results.csv \
92 --zstd programs/zstd
93 echo "NOTE: The new results.csv is uploaded as an artifact to this job"
94 echo " If this fails, go to the Artifacts pane in CircleCI, "
95 echo " download /tmp/circleci-artifacts/results.csv, and if they "
96 echo " are still good, copy it into the repo and commit it."
97 echo "> diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv"
98 diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv
99 # Only save the cache on success (default), since if the failure happened
100 # before we stamp the data cache, we will have a bad cache for this key.
101 - save_cache:
102 key: regression-cache-{{ checksum "tests/regression/data.c" }}-v0
103 paths:
104 - tests/regression/cache
105 - store_artifacts:
106 path: /tmp/circleci-artifacts
107
Nick Terrell3ff60402018-09-25 16:10:17 -0700108
109workflows:
110 version: 2
111 commit:
112 jobs:
113 # Run the tests in parallel
114 - short-tests-0:
115 filters:
116 tags:
117 only: /.*/
118 - short-tests-1:
119 filters:
120 tags:
121 only: /.*/
Nick Terrell4aaa36f2018-11-20 12:37:43 -0800122 # Create a branch called regression and set it to dev to force a
123 # regression test run
124 - regression-test:
125 filters:
126 branches:
127 only:
128 - regression
Nick Terrell3ff60402018-09-25 16:10:17 -0700129 # Only run on release tags.
130 - publish-github-release:
131 requires:
132 - short-tests-0
133 - short-tests-1
134 filters:
135 branches:
136 ignore: /.*/
137 tags:
138 only: /^v\d+\.\d+\.\d+$/
Nick Terrell4aaa36f2018-11-20 12:37:43 -0800139 nightly:
140 triggers:
141 - schedule:
142 cron: "0 0 * * *"
143 filters:
144 branches:
145 only:
146 - master
147 - dev
148 jobs:
149 # Run daily long regression tests
150 - regression-test
151
152
W. Felix Handte65187452018-08-08 14:09:12 -0700153
154 # Longer tests
155 #- make -C tests test-zstd-nolegacy && make clean
156 #- pyenv global 3.4.4; make -C tests versionsTest && make clean
157 #- make zlibwrapper && make clean
158 #- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean
159 #- make uasan && make clean
160 #- make asan32 && make clean
161 #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu"
162 # Valgrind tests
163 #- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean
164 #- make -C tests valgrindTest && make clean
165 # ARM, AArch64, PowerPC, PowerPC64 tests
166 #- make ppctest && make clean
167 #- make ppc64test && make clean
168 #- make armtest && make clean
169 #- make aarch64test && make clean