aboutsummaryrefslogtreecommitdiffhomepage
path: root/ext/detours/.github/workflows/main.yml
blob: c7fedcd62aab4f12aa31fa8e72211a3a6dfb8699 (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
name: CI-Build

env:
  # Turn on msvc analysis during build, enable once warnings are clean.
  DETOURS_ANALYZE: true

  # Compile in parallel where possible.
  CL: /MP

# Triggers the workflow on push or pull request events for the master branch.
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-2019, windows-2016]
        arch: [x86, x64, x64_arm, x64_arm64]

    steps:
      - name: Clone Repository
        uses: actions/checkout@v2
        with:
          # Must fetch at least the immediate parents so that if this is
          # a pull request then we can checkout the head of the pull request.
          # Only include this option if you are running this workflow on pull requests.
          fetch-depth: 2

      # If this run was triggered by a pull request event then checkout
      # the head of the pull request instead of the merge commit.
      # Only include this step if you are running this workflow on pull requests.
      - name: Checkout head of the pull request
        run: git checkout HEAD^2
        if: ${{ github.event_name == 'pull_request' }}

      # Setup build environment variables using vcvarsall.bat.
      - name: Configure MSCV Compiler for ${{ matrix.arch }}
        uses: ilammy/msvc-dev-cmd@v1.4.1
        with:
          arch: ${{ matrix.arch }}

      - name: Initialize CodeQL for C++
        uses: github/codeql-action/init@v1
        if: ${{ matrix.os == 'windows-2019' }}
        with:
          languages: cpp
          config-file: ./.github/codeql/codeql-config.yml

      - name: Build Detours for ${{ matrix.arch }} on ${{ matrix.os }} 
        env:
          # Tell detours what process to target
          DETOURS_TARGET_PROCESSOR: ${{ env.VSCMD_ARG_TGT_ARCH }}
        run: nmake

      - name: Run unit tests for ${{ matrix.arch }} on ${{ matrix.os }} 
        id: run-unit-tests
        run: cd tests && nmake test
        if: ${{ matrix.arch == 'x86' || matrix.arch == 'x64' }}

      - name: Upload artifacts for ${{ matrix.arch }} on ${{ matrix.os }} 
        uses: actions/upload-artifact@v2
        with:
          name: artifacts-${{ matrix.os }}
          path: |
            lib.*/
            bin.*/
            include/

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v1
        if: ${{ matrix.os == 'windows-2019' }}