summaryrefslogtreecommitdiff
path: root/.github/actions/configure-and-build/action.yml
blob: ace887be17b486f9b378011f07b34c54a8e8b77e (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
name: Configure and build
description: Run configure script and build
inputs:
  configure-env:
    default: ""
  configure-config:
    default: ""
  build-shared:
    default: true
  build-static:
    default: true
outputs:
  shared-build-dir:
    description: build directory of the shared build
    value: ${{ steps.shared-build.outputs.build-dir }}
  static-build-dir:
    description: build directory of the static build
    value: ${{ steps.static-build.outputs.build-dir }}
runs:
  using: composite
  steps:
    - name: Shared build
      id: shared-build
      shell: bash
      run: |
        echo "::group::Shared build"
        if [[ "${{ inputs.build-shared }}" != "true" ]]; then exit 0; fi
        ${{ inputs.configure-env }} ./configure.sh ${{ inputs.configure-config }} \
          --prefix=$(pwd)/build-shared/install --werror --name=build-shared
        
        # can not use `ccache --set-config=base_dir=` due to ccache bug, fixed with 3.7.10
        cd build-shared/ && pwd=$(pwd)
        $SED -i.orig -n -e '/^base_dir = /!p' -e "\$abase_dir = $pwd" $CCACHE_CONFIGPATH
        
        make -j${{ env.num_proc }}

        echo "::set-output name=build-dir::$pwd"
        echo "::endgroup::"

    - name: Static build
      id: static-build
      shell: bash
      run: |
        echo "::group::Static build"
        if [[ "${{ inputs.build-static }}" != "true" ]]; then exit 0; fi
        ${{ inputs.configure-env }} ./configure.sh ${{ inputs.configure-config }} \
          --prefix=$(pwd)/build-static/install --werror --static --name=build-static --no-java-bindings

        cd build-static/ && pwd=$(pwd)
        $SED -i.orig -n -e '/^base_dir = /!p' -e "\$abase_dir = $pwd" $CCACHE_CONFIGPATH

        make -j${{ env.num_proc }}

        echo "::set-output name=build-dir::$pwd"
        echo "::endgroup::"
        
    - name: Reset ccache base_dir
      shell: bash
      run: |
        echo "::group::Reset ccache base_dir"
        $SED -i.orig -n -e '/^base_dir = /!p' -e "\$abase_dir =" $CCACHE_CONFIGPATH
        echo "::endgroup::"
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback