summaryrefslogtreecommitdiff
path: root/.github/workflows/mnv-ci.yml
blob: eb2bf593ebba91bb7de499fdc6ddefcfd24b477b (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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: "mnv: CI"

on:
  workflow_dispatch:
  workflow_call:

concurrency:
  group: mnv-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  linux:
    runs-on: ${{ matrix.architecture == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}

    env:
      CC: ${{ matrix.compiler }}
      GCC_VER: 14
      CLANG_VER: 21
      TEST: test
      SRCDIR: ./src
      LEAK_CFLAGS: -DEXITFREE
      LOG_DIR: ${{ github.workspace }}/logs
      TERM: xterm
      DISPLAY: ':99'
      DEBIAN_FRONTEND: noninteractive

    strategy:
      fail-fast: false
      matrix:
        features: [tiny, normal, huge]
        compiler: [clang, gcc]
        extra: [[]]
        architecture: [native]
        include:
          - features: tiny
            compiler: clang
            extra: [nogui]
          - features: tiny
            compiler: gcc
            extra: [nogui]
          - features: tiny
            compiler: gcc
            extra: [nogui]
            architecture: arm64
          - features: huge
            coverage: true
          - features: huge
            compiler: clang
            interface: dynamic
            python3: stable-abi
          - features: huge
            compiler: gcc
            coverage: true
            interface: dynamic
            extra: [uchar, testgui]
          - features: huge
            compiler: gcc
            coverage: true
            extra: [unittests]
          - features: huge
            compiler: gcc
            coverage: true
            extra: [unittests]
            architecture: arm64
          - features: normal
            compiler: gcc
            extra: [vimtags, proto, codestyle]

    defaults:
      run:
        working-directory: mnv

    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Install dependencies
        run: |
          sudo apt-get update && sudo apt-get install -y \
            autoconf \
            clang \
            lcov \
            gettext \
            libcanberra-dev \
            libperl-dev \
            python3-dev \
            liblua5.4-dev \
            lua5.4 \
            ruby-dev \
            tcl-dev \
            libsodium-dev \
            libgtk-3-dev \
            desktop-file-utils \
            libtool-bin

      - name: Build
        run: |
          if [ "${{ matrix.features }}" = "tiny" ]; then
            ./configure --with-features=tiny --disable-gui
          elif [ "${{ matrix.features }}" = "normal" ]; then
            ./configure --with-features=normal --disable-gui
          else
            ./configure --with-features=huge \
              --enable-perlinterp \
              --enable-pythoninterp \
              --enable-python3interp \
              --enable-rubyinterp \
              --enable-luainterp \
              --enable-tclinterp \
              --enable-gui=gtk3
          fi
          make -j"$(nproc)"

      - name: Test
        timeout-minutes: 25
        run: |
          make "$TEST"

      - name: Upload test artifacts
        if: failure()
        uses: ./.github/actions/mnv/test_artifacts

  macos:
    runs-on: ${{ matrix.runner }}

    env:
      CC: clang
      TEST: test
      SRCDIR: ./src
      LEAK_CFLAGS: -DEXITFREE
      TERM: xterm

    strategy:
      fail-fast: false
      matrix:
        features: [tiny, normal, huge]
        runner: [macos-15]

    defaults:
      run:
        working-directory: mnv

    steps:
      - name: Checkout repository
        uses: actions/checkout@v6

      - name: Install dependencies
        run: brew install lua

      - name: Build
        run: |
          if [ "${{ matrix.features }}" = "tiny" ]; then
            ./configure --with-features=tiny --disable-gui
          elif [ "${{ matrix.features }}" = "normal" ]; then
            ./configure --with-features=normal --disable-gui
          else
            ./configure --with-features=huge \
              --enable-python3interp \
              --enable-rubyinterp \
              --enable-luainterp \
              --enable-tclinterp
          fi
          make -j"$(sysctl -n hw.logicalcpu)"

      - name: Test
        timeout-minutes: 25
        run: |
          make "$TEST"