aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci_rspamd_build.yml
blob: 9503f1974f78170e1689d47b1405e78950beaaf9 (plain)
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
name: rspamd_build

on:
  workflow_call:
    inputs:
      image:
        required: true
        type: string
      name:
        required: true
        type: string

jobs:
  test:
    runs-on: [ "ubuntu-latest" ]
    container:
      image: ${{ inputs.image }}
      options: --user root
    steps:
      - name: Create directories
        run: |
          sudo mkdir -p ${GITHUB_WORKSPACE}

      - name: Check out source code
        uses: actions/checkout@v4
        with:
          path: 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 ${GITHUB_WORKSPACE}/build
          cd ${GITHUB_WORKSPACE}/build
          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi 
          cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_COVERAGE=ON -DENABLE_LIBUNWIND=ON  -DENABLE_LUAJIT=ON -DLUA_ROOT=/luajit-build -DENABLE_HYPERSCAN=ON ${{ env.HYPERSCAN_ALTROOT }} ${GITHUB_WORKSPACE}/src

      - name: Build rspamd
        run: |
          if [[ -f /opt/rh/gcc-toolset-10/enable ]] ; then source /opt/rh/gcc-toolset-10/enable ; fi 
          cd ${GITHUB_WORKSPACE}/build
          ncpu=$(getconf _NPROCESSORS_ONLN)
          make -j $ncpu install
          make -j $ncpu rspamd-test
          make -j $ncpu rspamd-test-cxx

      - name: Run unit tests
        if: "!(inputs.name == 'ubuntu-ci' && runner.arch == 'ARM64')"
        run: |
          cd ${GITHUB_WORKSPACE}/build
          make test