File: cmake.yml

package info (click to toggle)
utf8proc 2.11.3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,836 kB
  • sloc: ansic: 19,168; lisp: 449; makefile: 242; sh: 7
file content (86 lines) | stat: -rw-r--r-- 2,558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: CMake

on:
  push:
    branches:
      - master
      - 'release-*'
  pull_request:
  # run on all pr

jobs:
  build:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        shared: ["ON", "OFF"]
    runs-on: ${{ matrix.os }}
    name: ${{ matrix.os }} - shared=${{ matrix.shared }}
    steps:
    - uses: actions/checkout@v6
    - name: Build
      run: |
        mkdir build
        cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=tmp/install
        cmake --build build
    - name: Run Test
      run: ctest --test-dir build -V
    - name: Upload shared lib
      if: matrix.shared == 'ON'
      uses: actions/upload-artifact@v6
      with:
        name: ${{ matrix.os }}
        path: |
          build/libutf8proc.*
          build/Debug/utf8proc.*
    - name: Test Consuming (Windows)
      if: runner.os == 'Windows'
      run: |
        cmake --install build --config Debug
        cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install
        cmake --build test/app/build
        $Env:PATH = "$PWD\tmp\install\bin;$Env:PATH"
        test/app/build/Debug/app.exe
    - name: Test Consuming (Unix)
      if: runner.os != 'Windows'
      run: |
        cmake --install build
        cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install
        cmake --build test/app/build
        test/app/build/app

  mingw:
    strategy:
      matrix:
        os: [windows-latest]
        shared: ["ON", "OFF"]
    runs-on: ${{ matrix.os }}
    name: mingw64 - shared=${{ matrix.shared }}
    defaults:
      run:
        shell: msys2 {0}
    steps:
    - uses: actions/checkout@v6
    - uses: msys2/setup-msys2@v2
      with:
        install: gcc make mingw-w64-x86_64-cmake
    - name: Build
      run: |
        mkdir build
        cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -G'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX=tmp/install
        cmake --build build
    - name: Run Test
      run: ctest --test-dir build -V
    - name: Upload shared lib
      if: matrix.shared == 'ON'
      uses: actions/upload-artifact@v6
      with:
        name: windows-mingw64
        path: build/libutf8proc.*
    - name: Test Consuming
      run: |
        cmake --install build
        cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install -G'MSYS Makefiles'
        cmake --build test/app/build
        PATH="$(pwd)/tmp/install/bin:$PATH"
        test/app/build/app.exe