OSDN Git Service

[Chore] MSVCでのビルドテストを行うワークフロー
[hengbandforosx/hengbandosx.git] / .github / workflows / build-with-autotools.yml
1 name: Build with Autotools
2
3 on:
4   workflow_call:
5     inputs:
6       cxx:
7         type: string
8         required: true
9       cxx-flags:
10         type: string
11         required: true
12       configure-opts:
13         type: string
14         required: false
15       distcheck:
16         type: boolean
17         required: false
18       use-ccache:
19         type: boolean
20         required: false
21
22 jobs:
23   build:
24     runs-on: ubuntu-22.04
25     steps:
26       - uses: actions/checkout@v3
27         with:
28           submodules: true
29
30       - if: ${{ inputs.use-ccache }}
31         uses: hendrikmuhs/ccache-action@v1.2
32
33       - name: Configuring ccache to use precompiled headers
34         if: ${{ inputs.use-ccache }}
35         run: |
36           ln -s /usr/bin/ccache /usr/local/bin/${{ inputs.cxx }}
37           /usr/bin/ccache --set-config=sloppiness=pch_defines,time_macros,include_file_mtime,include_file_ctime
38           /usr/bin/ccache --set-config=pch_external_checksum=true
39           /usr/bin/ccache -p
40
41       - name: Install required packages
42         run: |
43           sudo apt-get update
44           sudo apt-get install \
45             libncursesw5-dev \
46             libcurl4-openssl-dev \
47             nkf \
48
49       - name: Generate configure
50         run: ./bootstrap
51
52       - name: Configure
53         run: ./configure ${{ inputs.configure-opts }}
54         env:
55           CXX: ${{ inputs.cxx }}
56           CXXFLAGS: ${{ inputs.cxx-flags }}
57
58       - name: Build with distcheck
59         if: ${{ inputs.distcheck }}
60         run: make DISTCHECK_CONFIGURE_FLAGS="CXX=\"${{ inputs.cxx }}\" CXXFLAGS=\"${{ inputs.cxx-flags }}\" ${{ inputs.configure-opts }}" -j$(nproc) distcheck >/dev/null
61
62       - name: Build
63         if: ${{ !inputs.distcheck }}
64         run: make -j$(nproc) >/dev/null