Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build-macos.yml « workflows « .github - github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67a07ef8d8a0c6df0a86c7f52b67cf8754161dbb (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
54
55
56
57
58
59
60
61
62
63
name: Build Bareos Client on MacOS

on:
  push:
    branches:
      - macbuild-of*
env:
  target_dir: "${{ github.workspace }}/BUILD_RESULTS/MacOS"

jobs:
  build:
    name: Build and test MacOS
    runs-on: macos-12

    steps:

    - name: "Checkout source"
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: "Checkout tags"
      # for get-version.sh, an unshallow git checkout with tags is needed.
      run:  git fetch --tag

    - name: Install dependencies
      run: |
        brew install jansson

    - name: Build pkg
      run: |
        mkdir cmake-build
        cd cmake-build
        export CXXFLAGS="-I/usr/local/include"
        cmake .. -Dclient-only=yes
        make package VERBOSE=1
        ls -la ./*.pkg
        mkdir -p "${{ env.target_dir }}"
        mv ./*.pkg "${{ env.target_dir }}"

    - name: Ctest
      run: |
        cd cmake-build
        # check if we are modern enough
        if [ -f "../core/src/tests/bsock_mock.h" ]; then
            result=0
            ctest --repeat until-pass:5 -V -S CTestScript.cmake || result=$?
            if [ $result -eq 1 ]; then
                echo "ctest result $result is expected and OK"
            elif [ $result -eq 0 ]; then
                echo "ctest result $result is expected and OK"
            else
                echo "ctest result $result is not 1 or 0, ERROR"
            fi
        fi
        mv ./Testing "${{ env.target_dir }}"

    - name: Upload pkg
      uses: actions/upload-artifact@v3
      with:
        name: MacOS
        path: ${{ env.target_dir }}
        retention-days: 1