summaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/ci-windows.yml
blob: 53aee4da2a655e99c03cd5aa9f0cca190c3e4364 (plain) (blame)
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
name: CI (Windows)

on:
  push:
    paths:
    - '.github/workflows/**'
    - '3rdparty/**'
    - 'scripts/**'
    - 'src/**'
    - 'COPYING'
    - 'makefile'
  pull_request:
    paths:
    - '.github/workflows/**'
    - '3rdparty/**'
    - 'scripts/**'
    - 'src/**'
    - 'COPYING'
    - 'makefile'

permissions:
  contents: read

jobs:
  build-windows:
    strategy:
      matrix:
        compiler: [gcc-x64, clang-x64, clang-arm64]
        include:
          - compiler: gcc-x64
            os: windows-latest
            msys: UCRT64
            slug: mingw-w64-ucrt-x86_64
            cc: gcc
            cxx: g++
            subtarget: mame
            executable: mame
          - compiler: clang-x64
            os: windows-latest
            msys: CLANG64
            slug: mingw-w64-clang-x86_64
            extrapkg: mingw-w64-clang-x86_64-gcc-compat
            cc: clang
            cxx: clang++
            subtarget: tiny
            executable: mametiny
          - compiler: clang-arm64
            os: windows-11-arm
            msys: CLANGARM64
            slug: mingw-w64-clang-aarch64
            extrapkg: mingw-w64-clang-aarch64-gcc-compat
            cc: clang
            cxx: clang++
            subtarget: mame
            executable: mame
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: msys2 {0}
    steps:
    - uses: msys2/setup-msys2@v2
      with:
        msystem: ${{ matrix.msys }}
        install: git make ${{ matrix.slug }}-${{ matrix.cc }} ${{ matrix.slug }}-python ${{ matrix.slug }}-lld ${{ matrix.slug }}-llvm ${{ matrix.slug }}-libc++ ${{ matrix.extrapkg }}
    - uses: actions/checkout@main
      with:
        fetch-depth: 0
    - name: Build
      env:
        OVERRIDE_AR: "llvm-ar"
        OVERRIDE_CC: ${{ matrix.cc }}
        OVERRIDE_CXX: ${{ matrix.cxx }}
        ARCHOPTS: "-fuse-ld=lld"
        SUBTARGET: ${{ matrix.subtarget }}
        TOOLS: 1
      run: make -j3
    - name: Validate
      run: ./${{ matrix.executable }}.exe -validate
    - uses: actions/upload-artifact@main
      with:
        name: ${{ matrix.executable }}-windows-${{ matrix.compiler }}-${{ github.sha }}
        path: |
          ${{ matrix.executable }}.exe
          chdman.exe
          unidasm.exe
        if-no-files-found: error