summaryrefslogtreecommitdiff
path: root/.github/workflows/unusedargs_missingreturn.yml
blob: 4367ce556caf17b349ef84d3cf611aa33861c131 (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
name: UnusedMissingReturn
# this workflow checks for
# * unused input arguments
# * missing return values
# * strict prototypes
# some users have default configs that will needlessly fail Meson self-tests due to these syntax.
env:
  CFLAGS: "-Werror=unused-parameter -Werror=return-type -Werror=strict-prototypes"
  CPPFLAGS: "-Werror=unused-parameter -Werror=return-type"
  FFLAGS: "-fimplicit-none"

concurrency:
  group: unusedargs-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

on:
  push:
    paths:
    - ".github/workflows/unusedargs_missingreturn.yml"
    - "test cases/cmake/**"
    - "test cases/common/**"
    - "test cases/fortran/**"
    - "test cases/linuxlike/**"
    - "test cases/objc/**"
    - "test cases/objcpp/**"
    - "test cases/windows/**"

  pull_request:
    paths:
    - ".github/workflows/unusedargs_missingreturn.yml"
    - "test cases/cmake/**"
    - "test cases/common/**"
    - "test cases/fortran/**"
    - "test cases/linuxlike/**"
    - "test cases/objc/**"
    - "test cases/objcpp/**"
    - "test cases/windows/**"

permissions:
  contents: read

jobs:

  linux:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-python@v5
      with:
        python-version: '3.x'
    - name: Install Compilers
      run: |
        sudo apt update -yq
        sudo apt install -yq --no-install-recommends g++ gfortran ninja-build gobjc gobjc++
    - run: ./run_project_tests.py --only cmake common fortran platform-linux "objective c" "objective c++"
      env:
        MESON_CI_JOBNAME: linux-ubuntu-gcc-werror

  windows:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-python@v5
      with:
        python-version: '3.x'

    - run: pip install ninja pefile

    - run: python ./run_project_tests.py --only platform-windows
      env:
        CC: gcc
        CXX: g++
        FC: gfortran
        MESON_CI_JOBNAME: msys2-gcc-werror