-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #237 from mity/expand_ci
Expand continouous integration
- Loading branch information
Showing
3 changed files
with
93 additions
and
87 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 |
---|---|---|
|
@@ -5,7 +5,12 @@ on: | |
- push | ||
|
||
jobs: | ||
linux: | ||
# Linux builds. | ||
# | ||
# gcc sometimes warns (e.g. about potentially uninitialized variables) only | ||
# when some optimizations are enabled. So we build Debug as well as Release | ||
# on Linux. The Debug build also collects and uploads test coverage. | ||
linux-debug: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -15,7 +20,7 @@ jobs: | |
- name: Build | ||
run: make VERBOSE=1 | ||
- name: Test | ||
run: ./scripts/run-tests.sh | ||
run: python3 ./scripts/run-tests.py | ||
- name: Create coverage report | ||
run: | | ||
sudo apt-get install -y lcov | ||
|
@@ -25,22 +30,52 @@ jobs: | |
- name: Upload coverage report | ||
uses: codecov/codecov-action@v3 | ||
|
||
windows-32: | ||
linux-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure | ||
run: CFLAGS='--coverage -Werror' cmake -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' . | ||
- name: Build | ||
run: make VERBOSE=1 | ||
- name: Test | ||
run: python3 ./scripts/run-tests.py | ||
|
||
# Windows builds. | ||
# | ||
# We do both 32 and 64-bit builds. Also note 32-bit does Debug build while | ||
# 64-bit one does Release build. (Full matrix would likely be an overkill.) | ||
windows-32-debug: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: microsoft/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Dev command prompt | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x86 | ||
- name: Configure | ||
run: cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A Win32 . | ||
run: cmake -DCMAKE_BUILD_TYPE=Debug -G "NMake Makefiles" . | ||
- name: Build | ||
run: msbuild.exe md4c.sln /p:Configuration=Release /p:Platform=Win32 | ||
run: nmake | ||
- name: Setyp Python | ||
uses: actions/setup-python@v5 | ||
- name: Test | ||
run: python .\scripts\run-tests.py | ||
|
||
windows-64: | ||
windows-64-release: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: microsoft/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Dev command prompt | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x64 | ||
- name: Configure | ||
run: cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64 . | ||
run: cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" . | ||
- name: Build | ||
run: msbuild.exe md4c.sln /p:Configuration=Release /p:Platform=x64 | ||
run: nmake | ||
- name: Test | ||
run: python .\scripts\run-tests.py |
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,46 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import glob | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
|
||
argv0_dir = os.path.dirname(sys.argv[0]) | ||
project_dir = os.path.abspath(os.path.join(argv0_dir, "..")) | ||
test_dir = os.path.join(project_dir, "test") | ||
program = os.path.abspath(os.path.join("md2html", "md2html")) | ||
|
||
if __name__ == "__main__": | ||
err_count = 0 | ||
|
||
os.chdir(test_dir) | ||
|
||
for testsuite in glob.glob('*.txt'): | ||
print("Testing {}".format(testsuite)) | ||
sys.stdout.flush() | ||
sys.stderr.flush() | ||
args = [ | ||
sys.executable, | ||
"run-testsuite.py", | ||
"-s", testsuite, | ||
"-p", str(program) | ||
] | ||
p = subprocess.run(args) | ||
if p.returncode != 0: | ||
err_count += 1 | ||
print() | ||
|
||
print("Testing pathological inputs:") | ||
sys.stdout.flush() | ||
sys.stderr.flush() | ||
args = [ | ||
sys.executable, | ||
"pathological-tests.py", | ||
"-p", str(program) | ||
] | ||
subprocess.run(args) | ||
if p.returncode != 0: | ||
err_count += 1 | ||
|
||
sys.exit(err_count) |
This file was deleted.
Oops, something went wrong.