name: Build Windows

on:
  pull_request:
    branches:
      - master

jobs:
  build:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2
    - uses: ilammy/msvc-dev-cmd@v1
    - name: Install Packages
      run: |
        pip install meson==0.58.0 ninja
    - name: Build
      run: |
        meson --backend=ninja build
        where link
        ninja -C build install

    - uses: actions/upload-artifact@v2
      with:
        name: result
        path: build/src\thorvg*

  unit_test:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2
    - uses: ilammy/msvc-dev-cmd@v1
    - name: Install Packages
      run: |
        pip install meson==0.58.0 ninja

    - name: Build
      run: |
        meson --backend=ninja build -Dloaders="svg, tvg, png, jpg" -Dsavers="tvg" -Dbindings="capi" -Dtests=true
        where link
        ninja -C build test

