dd2997f0753c2f8d3a1632fef80114ebd42fa792
[fio.git] / .github / workflows / ci.yml
1 name: CI
2
3 on:
4   push:
5   pull_request:
6
7 jobs:
8   build:
9     runs-on: ${{ matrix.os }}
10     strategy:
11       fail-fast: false
12       matrix:
13         build:
14         - linux-gcc
15         - linux-clang
16         - macos
17         - linux-i686-gcc
18         - android
19         - windows-cygwin-64
20         - windows-cygwin-32
21         - windows-msys2-64
22         include:
23         - build: linux-gcc
24           os: ubuntu-22.04
25           cc: gcc
26         - build: linux-clang
27           os: ubuntu-22.04
28           cc: clang
29         - build: macos
30           os: macos-12
31         - build: linux-i686-gcc
32           os: ubuntu-22.04
33           arch: i686
34         - build: android
35           os: ubuntu-22.04
36           arch: aarch64-linux-android32
37         - build: android-recovery
38           os: ubuntu-22.04
39           arch: aarch64-linux-android32
40         - build: windows-cygwin-64
41           os: windows-latest
42           arch: x86_64
43           installer_arch: x64
44           shell: bash
45         - build: windows-cygwin-32
46           os: windows-latest
47           arch: i686
48           installer_arch: x86
49           shell: bash
50         - build: windows-msys2-64
51           os: windows-latest
52           cc: clang
53           arch: x86_64
54           installer_arch: x64
55           shell: msys2
56
57     env:
58       CI_TARGET_BUILD: ${{ matrix.build }}
59       CI_TARGET_ARCH: ${{ matrix.arch }}
60       CC: ${{ matrix.cc }}
61
62     steps:
63     - name: git config line endings (Windows)
64       if: ${{ contains( matrix.build, 'windows' ) }}
65       run: git config --global core.autocrlf input
66     - name: Checkout repo
67       uses: actions/checkout@v3
68     - name: Install Cygwin toolchain (Windows)
69       if: ${{ startsWith(matrix.build, 'windows-cygwin') }}
70       uses: cygwin/cygwin-install-action@master
71       with:
72         packages: >
73           mingw64-${{matrix.arch}}-binutils
74           mingw64-${{matrix.arch}}-CUnit
75           mingw64-${{matrix.arch}}-curl
76           mingw64-${{matrix.arch}}-dlfcn
77           mingw64-${{matrix.arch}}-gcc-core
78           mingw64-${{matrix.arch}}-headers
79           mingw64-${{matrix.arch}}-runtime
80           mingw64-${{matrix.arch}}-zlib
81
82     - name: Install msys2 toolchain (Windows)
83       if: ${{ startsWith(matrix.build, 'windows-msys2') }}
84       uses: msys2/setup-msys2@v2
85       with:
86         install: >
87           git
88           base-devel
89           mingw-w64-${{matrix.arch}}-clang
90           mingw-w64-${{matrix.arch}}-cunit
91           mingw-w64-${{matrix.arch}}-toolchain
92           mingw-w64-${{matrix.arch}}-lld
93           mingw-w64-${{matrix.arch}}-python-scipy
94           mingw-w64-${{matrix.arch}}-python-six
95           mingw-w64-${{matrix.arch}}-python-statsmodels
96           mingw-w64-${{matrix.arch}}-python-sphinx
97
98     - name: Install dependencies
99       run: ${{matrix.shell}} ./ci/actions-install.sh
100       if: ${{ !contains( matrix.build, 'msys2' ) }}
101     - name: Build
102       run:  ${{matrix.shell}} ./ci/actions-build.sh
103     - name: Build installer (Windows)
104       if: ${{ contains( matrix.build, 'windows' ) }}
105       shell: cmd
106       run: |
107         cd os\windows
108         dobuild.cmd ${{ matrix.installer_arch }}
109         cd ..\..
110
111     - name: Upload installer (Windows)
112       if: ${{ contains( matrix.build, 'windows' ) }}
113       uses: actions/upload-artifact@v3
114       with:
115         name: ${{ matrix.build }}-installer
116         path: os\windows\*.msi
117     - name: Remove dependency files to resolve Makefile Cygwin sed issue (Windows)
118       if: ${{ startsWith(matrix.build, 'windows-cygwin') }}
119       run: rm *.d */*.d */*/*.d
120       shell: bash
121     - name: Smoke test
122       run:  ${{matrix.shell}} ./ci/actions-smoke-test.sh
123     - name: Full test
124       run:  ${{matrix.shell}} ./ci/actions-full-test.sh