Skip to content

Commit d2322c8

Browse files
committed
ci: add github actions script
1 parent 1f0ab8f commit d2322c8

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
- push
3+
- pull_request
4+
jobs:
5+
test_unix:
6+
name: 'Test Unix with CMake'
7+
strategy:
8+
matrix:
9+
os: ['macos-latest', 'ubuntu-latest']
10+
config: ['Release', 'Debug']
11+
cmake_generator: ['Unix Makefiles', 'Ninja']
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- name: 'Checkout repo'
15+
uses: actions/checkout@v2
16+
- name: 'Install meson (Ubuntu)'
17+
if: ${{ contains(matrix.os, 'ubuntu') && (matrix.cmake_generator == 'Ninja') }}
18+
run: |
19+
sudo apt-get install ninja-build
20+
- name: 'Install meson (Macos)'
21+
if: ${{ contains(matrix.os, 'macos') && (matrix.cmake_generator == 'Ninja') }}
22+
run: |
23+
brew install meson
24+
- name: 'CMake configure'
25+
run: |
26+
mkdir build
27+
cd build
28+
cmake .. -G "${{ matrix.cmake_generator }}" -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DFLATCC_INSTALL=ON -DCMAKE_INSTALL_PREFIX=prefix
29+
- name: 'CMake build'
30+
run: |
31+
cmake --build build --parallel
32+
- name: 'CTest'
33+
run: |
34+
cd build
35+
ctest -V -C ${{ matrix.config }}
36+
- name: 'Install'
37+
run: |
38+
cmake --build build --target install
39+
test_windows:
40+
name: 'Test Windows with CMake'
41+
strategy:
42+
matrix:
43+
config: ['Release', 'Debug']
44+
arch: ['Win32', 'x64']
45+
runs-on: 'windows-latest'
46+
steps:
47+
- name: 'Checkout repo'
48+
uses: actions/checkout@v2
49+
- name: 'CMake configure'
50+
run: |
51+
mkdir build
52+
cd build
53+
cmake .. -A ${{ matrix.arch }} -DFLATCC_INSTALL=ON -DCMAKE_INSTALL_PREFIX=prefix
54+
- name: 'CMake build'
55+
run: |
56+
cmake --build build --parallel --config ${{ matrix.config }} --verbose
57+
- name: 'CTest'
58+
run: |
59+
cd build
60+
ctest -V -C ${{ matrix.config }}
61+
- name: 'Install'
62+
run: |
63+
cmake --build build --target install --config ${{ matrix.config }}

0 commit comments

Comments
 (0)