aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/cygwin.yml
blob: 5b1cd95ec3748a64288ae0eb2ac76f15ae0a2c3f (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
name: cygwin

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

on:
  push:
    paths:
      - "mesonbuild/**"
      - "test cases/**"
      - ".github/workflows/cygwin.yml"
      - "run*tests.py"
  pull_request:
    paths:
      - "mesonbuild/**"
      - "test cases/**"
      - ".github/workflows/cygwin.yml"
      - "run*tests.py"

permissions:
  contents: read

jobs:
  test:
    runs-on: windows-latest
    name: ${{ matrix.NAME }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - NAME: gccx64ninja
            ARCH: x86_64
    env:
      MESON_CI_JOBNAME: cygwin-${{ matrix.NAME }}

    steps:
      # cache should be saved on failure, but the action doesn't support that
      # https://github.com/actions/cache/issues/92
      - uses: actions/cache@v1
        with:
          # should use 'pip3 cache dir' to discover this path
          path: C:\cygwin\home\runneradmin\.cache\pip
          key: cygwin-pip-${{ github.run_number }}
          restore-keys: cygwin-pip-

      - run: git config --global core.autocrlf input

      - uses: actions/checkout@v3

      - uses: cygwin/cygwin-install-action@master
        with:
          platform: ${{ matrix.ARCH }}
          packages: |
            cmake
            gcc-fortran
            gcc-objc++
            gcc-objc
            git
            gobject-introspection
            gtk-doc
            libboost-devel
            libglib2.0-devel
            libgtk3-devel
            libxml2-devel
            libxslt-devel
            ninja
            python2-devel
            python3-devel
            python3-libxml2
            python3-libxslt
            python39-pip
            python39-wheel
            vala
            zlib-devel

      - name: work around gcovr bug https://github.com/gcovr/gcovr/pull/576
        run: |
          export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
          python3 -m pip --disable-pip-version-check install 'jinja2<3.1.0'
        shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'

      - name: Run pip
        run: |
          export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
          python3 -m pip --disable-pip-version-check install gcovr jsonschema pefile pytest pytest-subtests pytest-xdist coverage codecov
        shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'

      - name: Run tests
        run: |
          export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32
          python3 ./tools/run_with_cov.py run_tests.py --backend=ninja
        env:
          # Cygwin's static boost installation is broken (some static library
          # variants such as boost_thread are not present)
          SKIP_STATIC_BOOST: 1
        shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'

      - uses: actions/upload-artifact@v3
        with:
          name: ${{ matrix.NAME }}
          path: meson-test-run.*
        # test log should be saved on failure
        if: ${{ !cancelled() }}

      - name: Upload coverage report
        run: ./ci/upload_cov.sh "${{ matrix.NAME }}"