Skip to content

Commit bab7aec

Browse files
authored
[ci] set github CI (#229)
* [ci] set github CI: ubuntu, windows, macOS * [ci] add make.yml * [ci] Skip macOS check MANIFEST temporary
1 parent 27e8a16 commit bab7aec

2 files changed

Lines changed: 105 additions & 0 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CMake
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'release-*'
8+
pull_request:
9+
# run on all pr
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macOS-latest]
16+
shared: ["ON", "OFF"]
17+
runs-on: ${{ matrix.os }}
18+
name: ${{ matrix.os }} - shared=${{ matrix.shared }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Build
22+
run: |
23+
mkdir build
24+
cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON
25+
cmake --build build
26+
- name: Run Test
27+
run: ctest --test-dir build -V
28+
- name: Upload shared lib
29+
if: matrix.shared == 'ON'
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: ${{ matrix.os }}
33+
path: |
34+
build/libutf8proc.*
35+
build/Debug/utf8proc.*
36+
37+
mingw:
38+
strategy:
39+
matrix:
40+
os: [windows-latest]
41+
shared: ["ON", "OFF"]
42+
runs-on: ${{ matrix.os }}
43+
name: mingw64 - shared=${{ matrix.shared }}
44+
defaults:
45+
run:
46+
shell: msys2 {0}
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: msys2/setup-msys2@v2
50+
with:
51+
install: gcc make mingw-w64-x86_64-cmake
52+
- name: Build
53+
run: |
54+
mkdir build
55+
cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -G'MSYS Makefiles'
56+
cmake --build build
57+
- name: Run Test
58+
run: ctest --test-dir build -V
59+
- name: Upload shared lib
60+
if: matrix.shared == 'ON'
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: windows-mingw64
64+
path: build/libutf8proc.*

.github/workflows/make.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Make
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'release-*'
8+
pull_request:
9+
# run on all pr
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macOS-latest]
16+
runs-on: ${{ matrix.os }}
17+
name: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
# TODO: update makefile to check MANIFEST
21+
# - name: Install dependencies (MacOS)
22+
# if: matrix.config.os == 'macos-latest'
23+
# run: brew install ruby findutils
24+
25+
- name: Check MANIFEST
26+
if: matrix.config.os == 'ubuntu-latest'
27+
run: make manifest && diff MANIFEST.new MANIFEST
28+
- name: Run Test
29+
run: make check
30+
- name: Check utf8proc_data.c
31+
run: make data && diff data/utf8proc_data.c.new utf8proc_data.c
32+
- name: Clean
33+
run: make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)"
34+
35+
- name: Make lib
36+
run: make
37+
- name: Upload shared lib
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: make-${{ matrix.os }}
41+
path: libutf8proc.*

0 commit comments

Comments
 (0)