-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Unit Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-20.04] | ||
|
||
# workaround for matrix keys not allowed to be empty. we want | ||
# to manually specify the compilers for each platform. | ||
cc: [nocc] | ||
exclude: | ||
- cc: nocc | ||
|
||
include: | ||
- os: macos-latest | ||
cc: clang | ||
- os: ubuntu-20.04 | ||
cc: gcc | ||
- os: ubuntu-20.04 | ||
cc: tcc | ||
- os: windows-latest | ||
cc: cl | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Ninja (Ubuntu) | ||
if: contains(matrix.os, 'ubuntu') | ||
# sudo apt-get update -y && | ||
run: sudo apt-get install -y ninja-build | ||
|
||
- name: Install Ninja (macOS) | ||
if: contains(matrix.os, 'macos') | ||
run: brew install ninja | ||
|
||
- name: Install TinyCC (Ubuntu+tcc) | ||
if: contains(matrix.cc, 'tcc') | ||
run: sudo apt-get install -y tcc | ||
|
||
- name: Run ci-unix (Ubuntu, macOS) | ||
if: ${{ !contains(matrix.os, 'windows') }} | ||
run: test/unit/ci-unix.sh | ||
env: | ||
CC: ${{ matrix.cc }} | ||
|
||
- name: Run ci-windows (Windows) | ||
if: contains(matrix.os, 'windows') | ||
shell: cmd | ||
run: test\\unit\\ci-windows.bat |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,7 @@ | ||
@echo off | ||
|
||
REM Builds and runs the unit test suite under MSVC on Windows. | ||
REM | ||
REM This should be run in a normal command prompt, not a Visual Studio Build | ||
REM Tools command prompt. This script will find the build tools itself. | ||
REM | ||
REM This script is run by the continuous integration server to test MPack with | ||
REM MSVC on Windows. | ||
REM This script is run by the continuous integration server to build and run | ||
REM the MPack unit test suite with MSVC on Windows. | ||
|
||
setlocal enabledelayedexpansion | ||
|
||
REM Find vcvarsall.bat for latest Visual Studio | ||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\vcvarsall.bat`) do (SET "vcvarsall=%%i") | ||
|
||
REM Load compiler into PATH using vcvarsall.bat | ||
call "%vcvarsall%" amd64 | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
|
||
REM Load Python 3.8 into PATH on Appveyor | ||
if "%APPVEYOR%"=="True" ( | ||
path C:\Python38-x64;!PATH! | ||
) | ||
|
||
REM Run Python configuration | ||
python test\unit\configure.py | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
|
||
REM Build and run unit tests with Ninja | ||
ninja -f build\unit\build.ninja all | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
REM Run the "more" variant of unit tests | ||
call tools\unit.bat more |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@echo off | ||
|
||
REM Builds and runs the unit test suite under the Visual Studio C compiler on | ||
REM Windows. | ||
REM | ||
REM Pass a configuration to run or pass "all" to run all configurations. | ||
REM | ||
REM You can run this in a normal command prompt or in a Visual Studio Build | ||
REM Tools command prompt. It will find the build tools automatically if needed | ||
REM but it will run a lot faster if they are already available. | ||
|
||
setlocal enabledelayedexpansion | ||
|
||
REM Find build tools | ||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\vcvarsall.bat`) do (SET "vcvarsall=%%i") | ||
|
||
REM Enable build tools if needed | ||
where cl 1>NUL 2>NUL | ||
if %errorlevel% neq 0 call "%vcvarsall%" amd64 | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
|
||
REM Configure unit tests | ||
python test\unit\configure.py | ||
if %errorlevel% neq 0 exit /b %errorlevel% | ||
|
||
REM Run unit tests | ||
ninja -f test\.build\build.ninja %* | ||
if %errorlevel% neq 0 exit /b %errorlevel% |