summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build-and-test.yml
blob: 2372a71d60572382d6f32f0d127bd336b5eb0fe8 (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
name: build and test cv2pdb

on: [push, pull_request]

env:
  # Path to the solution file relative to the root of the project.
  SOLUTION_FILE_PATH: src/cv2pdb.vcxproj

  # Configuration type to build.
  BUILD_CONFIGURATION: Release
  BUILD_PLATFORM: x64
  BUILD_PLATFORM_TOOLSET: v142

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Add MSBuild to PATH
        uses: microsoft/setup-msbuild@v1.0.2
      - name: Build
        working-directory: ${{env.GITHUB_WORKSPACE}}
        run: msbuild /m /p:PlatformToolset=${{env.BUILD_PLATFORM_TOOLSET}} /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
      - name: Upload bin/
        uses: actions/upload-artifact@v2
        with:
          name: bin
          path: bin
  test-with-g4w-sdk:
    runs-on: windows-latest
    needs: build
    steps:
      - name: Download bin/
        uses: actions/download-artifact@v2
        with:
          name: bin
          path: bin
      - uses: git-for-windows/setup-git-for-windows-sdk@v1
      - name: verify using Git for Windows' GCC
        shell: bash
        run: |
          set -x &&
          cat >hello.c <<-\EOF &&
          #include <stdio.h>

          int main(int argc, char **argv)
          {
            printf("Hello, world\n");
            return 0;
          }
          EOF

          gcc -g -o hello.exe hello.c &&
          bin/${{env.BUILD_CONFIGURATION}}*/cv2pdb.exe hello.exe world.exe &&

          ls -l hello* world* &&

          curl -Lo cvdump.exe https://raw.githubusercontent.com/microsoft/microsoft-pdb/HEAD/cvdump/cvdump.exe &&
          ./cvdump.exe world.pdb >world.cvdump &&
          grep '^S_PUB32: .*, Flags: 00000000, main$' world.cvdump