diff options
author | Andrew Lewis <nerf@judo.za.org> | 2023-09-29 11:37:18 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2023-09-29 11:59:33 +0200 |
commit | 766c3f77b11177f8c831000d96b5f90936f12405 (patch) | |
tree | 1c079f044d5254f0cec14df33fee49ee3d65b3b5 /.drone.jsonnet | |
parent | 10cd630345ac0e214e4cdee58a2ea08898c8f7f0 (diff) | |
download | rspamd-766c3f77b11177f8c831000d96b5f90936f12405.tar.gz rspamd-766c3f77b11177f8c831000d96b5f90936f12405.zip |
[Test] Multiarchify tests
Diffstat (limited to '.drone.jsonnet')
-rw-r--r-- | .drone.jsonnet | 175 |
1 files changed, 113 insertions, 62 deletions
diff --git a/.drone.jsonnet b/.drone.jsonnet index 1123c25df..383ccdc01 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -3,7 +3,7 @@ local docker_pipeline = { type: 'docker', }; -local trigger = { +local default_trigger = { trigger: { event: [ 'push', @@ -14,6 +14,64 @@ local trigger = { }, }; +local platform(arch) = { + platform: { + os: 'linux', + arch: arch, + }, +}; + +local coveralls_attribs = { + branch: [ + 'master', + ], + event: [ + 'push', + 'tag', + ], +}; + +local coveralls_trigger = { + trigger: coveralls_attribs, +}; + +local coveralls_when = { + when: coveralls_attribs, +}; + +local notify_pipeline = { + name: 'notify', + depends_on: [ + 'default-amd64', + 'default-arm64', + 'default-noarch', + ], + steps: [ + { + name: 'notify', + image: 'drillster/drone-email', + pull: 'if-not-exists', + settings: { + from: 'noreply@rspamd.com', + host: { + from_secret: 'email_host', + }, + username: { + from_secret: 'email_username', + }, + password: { + from_secret: 'email_password', + }, + }, + }, + ], + trigger: { + status: [ + 'failure', + ], + }, +} + docker_pipeline; + local pipeline(arch) = { local rspamd_volumes = { volumes: [ @@ -23,11 +81,10 @@ local pipeline(arch) = { }, ], }, - name: 'default', - platform: { - os: 'linux', - arch: arch, - }, + local hyperscan_altroot = if (arch) == 'amd64' then '' else '-DHYPERSCAN_ROOT_DIR=/vectorscan', + depends_on: [ + ], + name: 'default-' + arch, steps: [ { name: 'prepare', @@ -47,7 +104,7 @@ local pipeline(arch) = { commands: [ 'test "$(id -un)" = nobody', 'cd /rspamd/build', - 'cmake -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON -GNinja $DRONE_WORKSPACE\n', + 'cmake -DCMAKE_INSTALL_PREFIX=/rspamd/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON ' + hyperscan_altroot + ' -GNinja $DRONE_WORKSPACE\n', 'ncpu=$(getconf _NPROCESSORS_ONLN)', 'ninja -j $ncpu install', 'ninja -j $ncpu rspamd-test', @@ -66,7 +123,7 @@ local pipeline(arch) = { 'cd /rspamd/fedora/build', "export LDFLAGS='-fuse-ld=lld'", 'export ASAN_OPTIONS=detect_leaks=0', - 'cmake -DCMAKE_INSTALL_PREFIX=/rspamd/fedora/install -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_CLANG_PLUGIN=ON -DENABLE_FULL_DEBUG=ON -DENABLE_HYPERSCAN=ON -DSANITIZE=address $DRONE_WORKSPACE\n', + 'cmake -DCMAKE_INSTALL_PREFIX=/rspamd/fedora/install -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_CLANG_PLUGIN=ON -DENABLE_FULL_DEBUG=ON -DENABLE_HYPERSCAN=ON ' + hyperscan_altroot + ' -DSANITIZE=address $DRONE_WORKSPACE\n', 'ncpu=$(getconf _NPROCESSORS_ONLN)', 'make -j $ncpu install', 'make -j $ncpu rspamd-test', @@ -160,37 +217,49 @@ local pipeline(arch) = { 'cd /rspamd/build', '$DRONE_WORKSPACE/test/tools/gcov_coveralls.py --exclude test --prefix /rspamd/build --prefix $DRONE_WORKSPACE --out coverage.c.json', 'luacov-coveralls -o coverage.functional.lua.json --dryrun', - '$DRONE_WORKSPACE/test/tools/merge_coveralls.py --root $DRONE_WORKSPACE --input coverage.c.json unit_test_lua.json coverage.functional.lua.json --token=$COVERALLS_REPO_TOKEN', + '$DRONE_WORKSPACE/test/tools/merge_coveralls.py --parallel --root $DRONE_WORKSPACE --input coverage.c.json unit_test_lua.json coverage.functional.lua.json --token=$COVERALLS_REPO_TOKEN', ], environment: { COVERALLS_REPO_TOKEN: { from_secret: 'coveralls_repo_token', }, }, - when: { - branch: [ - 'master', - ], - event: [ - 'push', - 'tag', - ], - }, - } + rspamd_volumes, + } + coveralls_when + rspamd_volumes, + ], + volumes: [ { - name: 'eslint', - image: 'node:18-alpine', - pull: 'if-not-exists', - failure: 'ignore', + name: 'rspamd', + temp: {}, + }, + ], +} + platform(arch) + default_trigger + docker_pipeline; + +local close_coveralls = { + name: 'close_coveralls', + depends_on: [ + 'default-amd64', + 'default-arm64', + ], + steps: [ + { + name: 'close_coveralls', + image: 'rspamd/ci:ubuntu-test-func', + pull: 'always', commands: [ - 'npm install', - './node_modules/.bin/eslint -v', - './node_modules/.bin/eslint ./', - './node_modules/.bin/stylelint -v', - 'npm show stylelint-config-standard version', - './node_modules/.bin/stylelint ./**/*.css ./**/*.html ./**/*.js', + '$DRONE_WORKSPACE/test/tools/merge_coveralls.py --parallel-close --token=$COVERALLS_REPO_TOKEN', ], + environment: { + COVERALLS_REPO_TOKEN: { + from_secret: 'coveralls_repo_token', + }, + }, }, + ], +} + coveralls_trigger + docker_pipeline; + +local noarch_pipeline = { + name: 'default-noarch', + steps: [ { name: 'perl-tidyall', image: 'rspamd/ci:perl-tidyall', @@ -203,43 +272,21 @@ local pipeline(arch) = { ], }, { - name: 'notify', - image: 'drillster/drone-email', + name: 'eslint', + image: 'node:18-alpine', pull: 'if-not-exists', - depends_on: [ - 'rspamd-test', - 'test-fedora-clang', - 'functional', - 'send-coverage', - 'eslint', - 'perl-tidyall', + failure: 'ignore', + commands: [ + 'npm install', + './node_modules/.bin/eslint -v', + './node_modules/.bin/eslint ./', + './node_modules/.bin/stylelint -v', + 'npm show stylelint-config-standard version', + './node_modules/.bin/stylelint ./**/*.css ./**/*.html ./**/*.js', ], - settings: { - from: 'noreply@rspamd.com', - host: { - from_secret: 'email_host', - }, - username: { - from_secret: 'email_username', - }, - password: { - from_secret: 'email_password', - }, - }, - when: { - status: [ - 'failure', - ], - }, - }, - ], - volumes: [ - { - name: 'rspamd', - temp: {}, }, ], -} + trigger + docker_pipeline; +} + default_trigger + docker_pipeline; local signature = { kind: 'signature', @@ -248,5 +295,9 @@ local signature = { [ pipeline('amd64'), + pipeline('arm64'), + close_coveralls, + noarch_pipeline, + notify_pipeline, signature, ] |