summaryrefslogtreecommitdiff
path: root/.github/workflows/ci_ubuntu.yml
blob: 45c5317ba8ca8cedc9d0fbbee17c35ca57e726f9 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI Ubuntu

on:
  push:
      branches:
        - 'features/mingw-ci'
  pull_request:

  workflow_dispatch:


env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: RELWITHDEBINFO

jobs:
  CI:
    runs-on: [self-hosted, linux, ARM64, aws]
    strategy:
      fail-fast: false
      matrix:
        config:
          - {
              name: "GCC",
              cc: "gcc",
              cxx: "g++"
            }
      #    - {
      #        name: "Clang",
      #        cc: "clang-12",
      #        cxx: "clang-cpp-12"
      #      }
    name: ${{ matrix.config.name }}
    defaults:
      run:
        shell: bash

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Update apt (Ubuntu)
        env:
          DEBIAN_FRONTEND: noninteractive
        run: sudo -E apt-get update -qq -o Acquire::Retries=3

      - name: Add libheif PPA (Ubuntu)
        run: |
          sudo add-apt-repository ppa:strukturag/libde265
          sudo add-apt-repository ppa:strukturag/libheif

      - name: install Ubuntu dependencies
        env:
          DEBIAN_FRONTEND: noninteractive
        run:  sudo -E apt-get install --fix-missing -qq -o Acquire::Retries=3
              cmake clang-12 gcc build-essential libjpeg-turbo8-dev libimagequant-dev libde265-dev
              libpng-dev libwebp-dev libtiff5-dev libx265-dev 
              libheif-dev libfreetype-dev libheif-dev 
              libavifile-0.7-dev libxpm-dev libraqm-dev

      - name: Debug CC Env
        env:
          CC: ${{ matrix.config.cc }}
          CXX: ${{ matrix.config.cxx }}
        run: |
          echo $CC
          echo $CXX

      - name: Configure CMake
        env:
          CC: ${{ matrix.config.cc }}
          CXX: ${{ matrix.config.cxx }}
        run:
           cmake -DENABLE_PNG=1 -DENABLE_FREETYPE=1 -DENABLE_JPEG=1 -DENABLE_WEBP=1
          -DENABLE_TIFF=1 -DENABLE_XPM=1 -DENABLE_GD_FORMATS=1 -DENABLE_HEIF=1 -DENABLE_RAQM=1
          -DBUILD_TEST=1 -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

      - name: Build
        env:
          CC: ${{ matrix.config.cc }}
          CXX: ${{ matrix.config.cxx }}
        # Build your program with the given configuration
        run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4

      - name: Test Ubuntu
        working-directory: ${{github.workspace}}/build
        run: |
          export TMP=${{runner.temp}}
          echo "TMP=${{github.temp}}" >> $GITHUB_ENV
          echo "LSAN_OPTIONS=suppressions=${{ github.workspace }}/suppressions/lsan.supp" >> $GITHUB_ENV
          CTEST_OUTPUT_ON_FAILURE=1 ctest -C ${{env.BUILD_TYPE}}

      - name: Configure CMake ASAN Ubuntu
        env:
          CC: ${{ matrix.config.cc }}
          CXX: ${{ matrix.config.cxx }}
        run:
          cmake -DENABLE_PNG=1 -DENABLE_FREETYPE=1 -DENABLE_JPEG=1 -DENABLE_WEBP=1
              -DENABLE_TIFF=1 -DENABLE_XPM=1 -DENABLE_GD_FORMATS=1 -DENABLE_HEIF=1
              -DBUILD_TEST=1 -B ${{github.workspace}}/buildasan -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

      - name: Build ASAN Ubuntu
        env:
          CC: ${{ matrix.config.cc }}
          CXX: ${{ matrix.config.cxx }}
        run: cmake --build ${{github.workspace}}/buildasan --config ${{env.BUILD_TYPE}}

      - name: Test ASAN Ubuntu
        working-directory: ${{github.workspace}}/buildasan
        # Execute tests defined by the CMake configuration.  
        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
        run: |
          export TMP=${{runner.temp}}
          echo "TMP=${{github.temp}}" >> $GITHUB_ENV
          CTEST_OUTPUT_ON_FAILURE=1 ctest -C ${{env.BUILD_TYPE}}

      - name: Output Log
        if: contains(matrix.os, 'ubuntu')
        run: |
          if test -f "/home/runner/work/libgd/libgd/build/Testing/Temporary/LastTest.log"; then
              cat /home/runner/work/libgd/libgd/build/Testing/Temporary/LastTest.log
          fi