ci: upload tagged GitHub Actions Windows installers as releases
[fio.git] / .github / workflows / ci.yml
CommitLineData
ce1b5612
SW
1name: CI
2
3on:
4 push:
5 pull_request:
6
7jobs:
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
e448d863 17 - linux-i686-gcc
787c02a6 18 - android
89d08880
VF
19 - windows-cygwin-64
20 - windows-cygwin-32
21 - windows-msys2-64
ce1b5612
SW
22 include:
23 - build: linux-gcc
726a9585 24 os: ubuntu-22.04
ce1b5612
SW
25 cc: gcc
26 - build: linux-clang
726a9585 27 os: ubuntu-22.04
ce1b5612
SW
28 cc: clang
29 - build: macos
70d9a988 30 os: macos-12
e448d863
VF
31 - build: linux-i686-gcc
32 os: ubuntu-22.04
33 arch: i686
787c02a6 34 - build: android
726a9585 35 os: ubuntu-22.04
787c02a6 36 arch: aarch64-linux-android32
9b3cc2dd
BVA
37 - build: android-recovery
38 os: ubuntu-22.04
39 arch: aarch64-linux-android32
89d08880
VF
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
ce1b5612
SW
56
57 env:
787c02a6 58 CI_TARGET_BUILD: ${{ matrix.build }}
ce1b5612
SW
59 CI_TARGET_ARCH: ${{ matrix.arch }}
60 CC: ${{ matrix.cc }}
61
62 steps:
89d08880
VF
63 - name: git config line endings (Windows)
64 if: ${{ contains( matrix.build, 'windows' ) }}
65 run: git config --global core.autocrlf input
ce1b5612 66 - name: Checkout repo
2f160e0c 67 uses: actions/checkout@v3
89d08880
VF
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
ce1b5612 98 - name: Install dependencies
89d08880
VF
99 run: ${{matrix.shell}} ./ci/actions-install.sh
100 if: ${{ !contains( matrix.build, 'msys2' ) }}
ce1b5612 101 - name: Build
89d08880
VF
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
954b86f7 111 - name: Upload installer as artifact (Windows)
89d08880
VF
112 if: ${{ contains( matrix.build, 'windows' ) }}
113 uses: actions/upload-artifact@v3
114 with:
115 name: ${{ matrix.build }}-installer
116 path: os\windows\*.msi
954b86f7
VF
117 - name: Upload installer as release for tagged builds (Windows)
118 uses: softprops/action-gh-release@v1
119 if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.build, 'windows-cygwin') }}
120 with:
121 files: os/windows/*.msi
8b60e320
VF
122 - name: Remove dependency files to resolve Makefile Cygwin sed issue (Windows)
123 if: ${{ startsWith(matrix.build, 'windows-cygwin') }}
124 run: rm *.d */*.d */*/*.d
125 shell: bash
ce1b5612 126 - name: Smoke test
89d08880 127 run: ${{matrix.shell}} ./ci/actions-smoke-test.sh
ce1b5612 128 - name: Full test
89d08880 129 run: ${{matrix.shell}} ./ci/actions-full-test.sh