aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci_rspamd.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ci_rspamd.yml')
-rw-r--r--.github/workflows/ci_rspamd.yml99
1 files changed, 99 insertions, 0 deletions
diff --git a/.github/workflows/ci_rspamd.yml b/.github/workflows/ci_rspamd.yml
new file mode 100644
index 000000000..7c32e1cdc
--- /dev/null
+++ b/.github/workflows/ci_rspamd.yml
@@ -0,0 +1,99 @@
+name: rspamd_test
+
+on:
+ workflow_call:
+ inputs:
+ image:
+ required: true
+ type: string
+ name:
+ required: true
+ type: string
+
+env:
+ CTEST_OUTPUT_ON_FAILURE: 1
+ JOB_WORKDIR: ${{ github.workspace }}/${{ github.job }}-${{ inputs.name }}-${{ github.run_number }}
+ RSPAMD_LUA_EXPENSIVE_TESTS: 1
+
+jobs:
+ test:
+ runs-on: ["self-hosted", "linux", "${{ matrix.arch }}"]
+ strategy:
+ matrix:
+ arch: [ARM64, X64]
+ container:
+ image: ${{ inputs.image }}
+ steps:
+ - name: Create directories
+ run: |
+ sudo mkdir -p ${JOB_WORKDIR}
+ sudo chown -R build:build ${JOB_WORKDIR}
+
+ - name: Check out the repo
+ run: |
+ cd ${JOB_WORKDIR}
+ git clone ${{ github.server_url }}/${{ github.repository }} --branch ${{ github.ref_name }} --single-branch src
+
+ - name: Set variables on ARM64
+ if: runner.arch == 'ARM64'
+ run: echo "HYPERSCAN_ALTROOT=-DHYPERSCAN_ROOT_DIR=/vectorscan" >> "$GITHUB_ENV"
+
+ - name: Run cmake
+ run: |
+ mkdir ${JOB_WORKDIR}/build
+ cd ${JOB_WORKDIR}/build
+ cmake -DCMAKE_INSTALL_PREFIX=${JOB_WORKDIR}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON -DENABLE_HYPERSCAN=ON ${{ env.HYPERSCAN_ALTROOT }} -GNinja ${JOB_WORKDIR}/src
+
+ - name: Build rspamd
+ run: |
+ cd ${JOB_WORKDIR}/build
+ ncpu=$(getconf _NPROCESSORS_ONLN)
+ ninja -j $ncpu install
+ ninja -j $ncpu rspamd-test
+ ninja -j $ncpu rspamd-test-cxx
+
+ - name: Run unit tests
+ if: "!(inputs.name == 'ubuntu-ci' && runner.arch == 'ARM64')"
+ run: |
+ cd ${JOB_WORKDIR}/build
+ ninja test
+
+ - name: Apply Fedora specifics
+ if: inputs.name == 'fedora-ci'
+ run: |
+ sudo mv /usr/bin/miltertest /usr/bin/miltertest.is.broken.on.fedora || true
+
+ - name: Run functional tests
+ run: |
+ cd ${JOB_WORKDIR}/build
+ ulimit -c unlimited
+ ulimit -s unlimited
+ set +e
+ RSPAMD_INSTALLROOT=${JOB_WORKDIR}/install robot --removekeywords wuks --exclude isbroken ${JOB_WORKDIR}/src/test/functional/cases; EXIT_CODE=$?
+ set -e
+ core_files=$(find /var/tmp/ -name '*.core')
+ for core in $core_files; do exe=$(gdb --batch -ex 'info proc mappings' -c $core | tail -1 | awk '{print $5}'); gdb --batch -ex 'bt' -c $core $exe; echo '---'; done
+ exit $EXIT_CODE
+
+ # FIXME: upload test logs even on ARM
+ - name: Upload robot logs
+ if: runner.arch == 'X64' && (success() || failure())
+ uses: actions/upload-artifact@v4
+ with:
+ name: robotlog-${{ inputs.name }}
+ path: |
+ ${{ env.JOB_WORKDIR }}/build/*.*ml
+ retention-days: 1
+
+ - name: Upload rspamd logs
+ if: runner.arch == 'X64' && (success() || failure())
+ uses: actions/upload-artifact@v4
+ with:
+ name: rspamdlog-${{ inputs.name }}
+ path: ${{ env.JOB_WORKDIR }}/build/robot-save
+ retention-days: 1
+
+ - name: Cleanup working directory
+ if: always()
+ run: |
+ sudo rm -rf ${JOB_WORKDIR}