fix: handle empty string to number conversion #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build All | |
on: | |
push: | |
branches: ['main', 'dev', 'dev/*'] | |
pull_request: | |
branches: ['main'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test-windows: | |
name: Test (Windows) | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
config: [Release, Debug] | |
arch: [x64, x86] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download Foobar2000 SDK | |
run: | | |
curl -L https://www.foobar2000.org/files/SDK-2023-09-23.7z -o vendor/foobar2000_sdk.7z | |
7z x vendor/foobar2000_sdk.7z -ovendor/sdk | |
ls vendor/sdk | |
- name: Setup Msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Restore NuGet packages | |
working-directory: ${{ github.workspace }} | |
run: nuget restore foo_input_ncm.sln | |
- name: Build Test Executable | |
working-directory: ${{ github.workspace }} | |
run: | | |
msbuild foo_input_ncm.sln -property:"Configuration=${{ matrix.config }};Platform=${{ matrix.arch}}" -target:foo_input_ncm_tests | |
- name: Run Tests (x86) | |
working-directory: ${{ github.workspace }}/${{ matrix.config }} | |
run: .\foo_input_ncm_tests.exe --gtest_repeat=10 --gtest_shuffle | |
if: matrix.arch == 'x86' | |
- name: Run Tests (x64) | |
working-directory: ${{ github.workspace }}/${{ matrix.arch }}/${{ matrix.config }} | |
run: .\foo_input_ncm_tests.exe --gtest_repeat=10 --gtest_shuffle | |
if: matrix.arch == 'x64' | |
test-macos: | |
name: Test (macOS) | |
runs-on: macos-14 | |
strategy: | |
fail-fast: false | |
matrix: | |
config: [Release, Debug] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download Foobar2000 SDK | |
run: | | |
curl -L https://www.foobar2000.org/files/SDK-2023-09-23.7z -o vendor/foobar2000_sdk.7z | |
7z x vendor/foobar2000_sdk.7z -ovendor/sdk | |
ls vendor/sdk | |
- name: Setup GoogleTest Xcode Project | |
working-directory: ${{ github.workspace }}/vendor/googletest | |
run: | | |
mkdir build | |
cd build && cmake -G Xcode cmake -DCMAKE_BUILD_TYPE=${{ matrix.config }} .. | |
- name: Build Tests | |
working-directory: ${{ github.workspace }} | |
run: | | |
xcodebuild clean build -workspace foo_input_ncm.xcworkspace -scheme foo_input_ncm_tests -configuration ${{ matrix.config }} -derivedDataPath . | |
- name: Run Tests | |
working-directory: ${{ github.workspace }}/Build/Products/${{ matrix.config }} | |
run: | | |
./foo_input_ncm_tests --gtest_repeat=10 --gtest_shuffle | |
matrix-build: | |
name: Matrix Build | |
runs-on: ${{ matrix.os }} | |
needs: [test-windows, test-macos] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-14] | |
config: [Release, Debug] | |
arch: [x64, x86] | |
exclude: | |
- os: macos-14 | |
arch: x86 | |
include: | |
- os: windows-latest | |
build-command: msbuild | |
solution: foo_input_ncm.sln | |
- os: macos-14 | |
build-command: xcodebuild | |
workspace: foo_input_ncm.xcworkspace | |
project: foo_input_ncm.xcodeproj | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Versioning | |
run: | | |
TAG=$(git describe --long --all) | |
VERSION=${TAG:6} | |
echo "" >> src/stdafx.h | |
echo "#define CURRENT_VERSION $VERSION" >> src/stdafx.h | |
echo "----------------------------" | |
cat src/stdafx.h | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
- name: Download Foobar2000 SDK | |
run: | | |
curl -L https://www.foobar2000.org/files/SDK-2023-09-23.7z -o vendor/foobar2000_sdk.7z | |
7z x vendor/foobar2000_sdk.7z -ovendor/sdk | |
ls vendor/sdk | |
- name: (XCode) Switch XCode Version | |
run: | | |
sudo xcode-select --switch /Applications/Xcode_15.3.app | |
xcodebuild -version | |
if: matrix.os == 'macos-14' | |
- name: (XCode) List Scheme | |
run: | | |
xcodebuild -list -workspace ${{ matrix.workspace }} | |
echo Build with scheme: foo_input_ncm-${{ matrix.config }} | |
if: matrix.os == 'macos-14' | |
- name: (XCode) Build component bundle | |
env: | |
scheme: foo_input_ncm-${{ matrix.config }} | |
run: | | |
xcodebuild clean build -workspace ${{ matrix.workspace }} -scheme "$scheme" -configuration ${{ matrix.config }} -sdk macosx -mmacosx-version-min=13.3 | |
if: matrix.os == 'macos-14' | |
- name: (MSBuild) Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
if: matrix.os == 'windows-latest' | |
- name: (MSBuild) Restore NuGet packages | |
working-directory: ${{ github.workspace }} | |
run: nuget restore ${{ matrix.solution }} | |
if: matrix.os == 'windows-latest' | |
- name: (MSBuild) Build component dll | |
working-directory: ${{ github.workspace }} | |
run: msbuild ${{ matrix.solution }} -property:"Configuration=${{ matrix.config }};Platform=${{ matrix.arch}}" -target:foo_input_ncm | |
if: matrix.os == 'windows-latest' | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.config }} | |
path: ${{ github.workspace }}/dist | |
if-no-files-found: error |