summaryrefslogtreecommitdiff
path: root/.github/workflows/genqrcode-ci.yml
blob: 95630e72e77677c9b607c1d9419149ddf121f30b (plain)
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
name: "genqrcode: CI"

on:
  workflow_dispatch:
  workflow_call:

jobs:
  cmake:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    env:
      BUILD_TYPE: Release
    defaults:
      run:
        working-directory: genqrcode
    steps:
      - uses: actions/checkout@v6
      - name: Install vcpkg deps (Windows)
        if: matrix.os == 'windows-latest'
        uses: lukka/run-vcpkg@v11
        with:
          vcpkgGitCommitId: '77df67cfff9c12ccfdb52284e07c87c75092f723'
      - name: Install vcpkg packages (Windows)
        if: matrix.os == 'windows-latest'
        run: vcpkg install getopt:x64-windows libiconv:x64-windows libpng:x64-windows
      - name: Install deps (Ubuntu)
        if: matrix.os == 'ubuntu-latest'
        run: sudo apt-get update && sudo apt-get install -y libpng-dev
      - name: Install deps (macOS)
        if: matrix.os == 'macos-latest'
        run: brew install pkg-config libpng
      - name: Configure CMake
        if: matrix.os != 'windows-latest'
        run: cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DWITH_TESTS=yes -DBUILD_SHARED_LIBS=on -S . -B build
      - name: Configure CMake (Windows)
        if: matrix.os == 'windows-latest'
        run: cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DWITH_TESTS=yes -S . -B build
      - name: Build
        run: cmake --build build --config "$BUILD_TYPE" -j 2
      - name: Test
        run: ctest --test-dir build -C "$BUILD_TYPE"

  autotools:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    defaults:
      run:
        working-directory: genqrcode
    steps:
      - uses: actions/checkout@v6
      - name: Install deps (macOS)
        if: matrix.os == 'macos-latest'
        run: brew install automake autoconf libtool pkg-config libpng
      - name: Generate configure
        run: ./autogen.sh
      - name: Configure
        run: ./configure --with-tests
      - name: Build
        run: make -j 2
      - name: Test
        run: make check
      - name: Distcheck
        run: make -j 2 distcheck