Skip to content

docs: Update license #1416

docs: Update license

docs: Update license #1416

Workflow file for this run

# Copyright (c) Omar Boukli-Hacene. All rights reserved.
# Distributed under an MIT-style license that can be
# found in the LICENSE file.
# SPDX-License-Identifier: MIT
name: MSBuild build on Windows
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
permissions: {}
jobs:
build:
name: Build
runs-on: windows-latest
env:
SOLUTION_FILE_PATH: msbuild\TrominoPuzzle.sln
RELEASE_BUILD_CONFIGURATION: Release
DEBUG_BUILD_CONFIGURATION: Debug
BUILD_PLATFORM: x64
RELEASE_WORKDIR: ${{ github.workspace }}\msbuild\x64\Release\
DEBUG_WORKDIR: ${{ github.workspace }}\msbuild\x64\Debug\
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check out vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
path: ${{ github.workspace }}\vcpkg
persist-credentials: false
- name: Bootstrap vcpkg
run: .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
- name: Apply vcpkg cache
id: vcpkg-cache
uses: actions/cache@v3
with:
path: |-
%VCPKG_DEFAULT_BINARY_CACHE%
${{ github.workspace }}\vcpkg
key: >-
${{ runner.os }}-vcpkg-archives-cache-${{ hashFiles(
'ci/cache-key-salt/windows.txt',
'vcpkg/ports/boost-test/vcpkg.json',
'vcpkg/ports/sdl2/vcpkg.json'
) }}
- name: Install Boost.Test vcpkg package
run: .\vcpkg install --triplet x64-windows-static boost-test
working-directory: vcpkg
- name: Install SDL2 vcpkg package
run: .\vcpkg install --triplet x64-windows sdl2
working-directory: vcpkg
- name: Integrate vcpkg
run: .\vcpkg integrate install
working-directory: vcpkg
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: ${{ env.BUILD_PLATFORM }}
- name: Build Release configuration
working-directory: ${{ github.workspace }}
run: >-
msbuild
-detailedSummary
-maxCpuCount
-property:Configuration=${{ env.RELEASE_BUILD_CONFIGURATION }}
-property:Platform=${{ env.BUILD_PLATFORM }}
-property:Tromino2dDefinitions="TROMINO_2D_HEADLESS"
-validate
-warnAsError
"${{ env.SOLUTION_FILE_PATH }}"
- name: Compute SHA512 of Release artifacts
run: |-
ls
Get-FileHash UnitTestsHost.exe -Algorithm SHA512
Get-FileHash tromino.exe -Algorithm SHA512
Get-FileHash tromino2d.exe -Algorithm SHA512
Get-FileHash libtromino_validation.lib -Algorithm SHA512
Get-FileHash libtromino.lib -Algorithm SHA512
Get-FileHash libtromino2d.lib -Algorithm SHA512
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Build Debug configuration
working-directory: ${{ github.workspace }}
run: >-
msbuild
-detailedSummary
-maxCpuCount
-property:Configuration=${{ env.DEBUG_BUILD_CONFIGURATION }}
-property:Platform=${{ env.BUILD_PLATFORM }}
-property:Tromino2dDefinitions="TROMINO_2D_HEADLESS"
-validate
-warnAsError
"${{ env.SOLUTION_FILE_PATH }}"
- name: Compute SHA512 of Debug artifacts
run: |-
ls
Get-FileHash UnitTestsHost.exe -Algorithm SHA512
Get-FileHash tromino.exe -Algorithm SHA512
Get-FileHash tromino2d.exe -Algorithm SHA512
Get-FileHash libtromino_validation.lib -Algorithm SHA512
Get-FileHash libtromino.lib -Algorithm SHA512
Get-FileHash libtromino2d.lib -Algorithm SHA512
working-directory: ${{ env.DEBUG_WORKDIR }}
# UnitTestsHost.exe
- name: Run unit tests (Debug)
run: |-
.\UnitTestsHost.exe
shell: cmd
working-directory: ${{ env.DEBUG_WORKDIR }}
- name: Run unit tests (Release)
run: |-
.\UnitTestsHost.exe
shell: cmd
working-directory: ${{ env.DEBUG_WORKDIR }}
# tromino.exe VT-100 mode
- name: Run tromino
run: |-
.\tromino.exe 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 5 0 0
run: |-
tromino.exe 5 0 0 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 2 0 7
run: |-
tromino.exe 2 0 7 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 2 0 1
run: |-
tromino.exe 2 0 1
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 8 3 5
run: |-
tromino.exe 8 3 5
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 8 3 5 (Debug)
run: |-
tromino.exe 8 3 5
shell: cmd
working-directory: ${{ env.DEBUG_WORKDIR }}
# tromino.exe Windows Console Host (WCH) mode
- name: Run tromino --use-wch
run: |-
.\tromino.exe --use-wch 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 5 0 0 --use-wch
run: |-
tromino.exe 5 0 0 --use-wch 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 2 0 7 --use-wch
run: |-
tromino.exe 2 0 7 --use-wch 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 2 0 1 --use-wch
run: |-
tromino.exe 2 0 1 --use-wch
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 8 3 5 --use-wch
run: |-
tromino.exe 8 3 5 --use-wch
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino 8 3 5 --use-wch (Debug)
run: |-
tromino.exe 8 3 5 --use-wch
shell: cmd
working-directory: ${{ env.DEBUG_WORKDIR }}
# tromino2d.exe
- name: Run tromino2d
run: |-
tromino2d.exe 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino2d 5 0 0
run: |-
tromino2d.exe 5 0 0 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino2d 1024 0 0
run: |-
tromino2d.exe 1024 0 0 2> nul && (exit /b 1) || (exit /b 0)
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino2d 4 0 0
run: |-
tromino2d.exe 4 0 0
shell: cmd
working-directory: ${{ env.RELEASE_WORKDIR }}
- name: Run tromino2d 4 0 0 (Debug)
run: |-
tromino2d.exe 4 0 0
shell: cmd
working-directory: ${{ env.DEBUG_WORKDIR }}