File: CI-cygwin.yml

package info (click to toggle)
cppcheck 2.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 26,412 kB
  • sloc: cpp: 272,462; python: 22,408; ansic: 8,088; sh: 1,059; makefile: 1,041; xml: 987; cs: 291
file content (61 lines) | stat: -rw-r--r-- 1,871 bytes parent folder | download | duplicates (3)
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
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-cygwin

on:
  push:
    branches:
      - 'main'
      - 'releases/**'
      - '2.*'
    tags:
      - '2.*'
  pull_request:

permissions:
  contents: read

defaults:
  run:
    shell: cmd

jobs:
  # TODO: add CMake build
  build_cygwin:
    strategy:
      matrix:
        # only use the latest windows-* as the installed toolchain is identical
        os: [windows-2025]
        platform: [x86_64]
        include:
          - platform: 'x86_64'
            packages: |
              gcc-g++
              python3
      fail-fast: false

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: Set up Cygwin
        uses: cygwin/cygwin-install-action@master
        with:
          platform: ${{ matrix.platform }}
          packages: ${{ matrix.packages }}

      # Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
      - name: Build all and run test
        run: |
          C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j%NUMBER_OF_PROCESSORS% CXXOPTS="-Werror" test

      - name: Extra test for misra
        run: |
          cd %GITHUB_WORKSPACE%\addons\test
          ..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
          python3 ..\misra.py -verify misra\misra-test.c.dump
          ..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c