Skip to content

Commit 28b4e25

Browse files
committed
CI uses make check, build.ps1 copyright
- Makefile: make the "check" target exit non-zero on a test mismatch instead of merely printing FAILED. - CI: rely on "make check" / "build.ps1 -Target check" exit codes rather than reimplementing the test/diff logic in YAML; compile-cover the OpenMP/SysV-shm path on Linux by building initrom and userom. - build.ps1: add the copyright/license header.
1 parent 4ff14be commit 28b4e25

3 files changed

Lines changed: 30 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,25 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v6
2020

21-
# Linux: the supplied Makefile works as-is (gcc, -lrt, OpenMP).
2221
- name: Build and test (Linux)
2322
if: runner.os == 'Linux'
2423
run: |
25-
make tests phc-test
26-
./tests > TESTS-OUT
27-
diff -u TESTS-OK TESTS-OUT
28-
echo PASSED
29-
./phc-test > PHC-TEST-OUT
30-
sha256sum -c PHC-TEST-OK-SHA256
31-
echo "PHC PASSED"
24+
make check
25+
make initrom userom
3226
33-
# macOS: Apple's linker has no -lrt and rejects the Makefile's -s flag,
34-
# so build with overridden flags. initrom/userom are skipped (they need
35-
# SysV shared memory).
27+
# macOS: Apple's linker has no -lrt and rejects the Makefile's -s flag, so
28+
# override CFLAGS/LDFLAGS. initrom/userom are skipped: they need SysV
29+
# shared memory, and OpenMP isn't bundled with Apple's clang.
3630
- name: Build and test (macOS)
3731
if: runner.os == 'macOS'
3832
run: |
39-
make tests phc-test \
33+
make check \
4034
CFLAGS="-Wall -O2 -fomit-frame-pointer -DSKIP_MEMZERO" \
4135
OMPFLAGS_MAYBE="" LDFLAGS=""
42-
./tests > TESTS-OUT
43-
diff -u TESTS-OK TESTS-OUT
44-
echo PASSED
45-
./phc-test > PHC-TEST-OUT
46-
shasum -a 256 -c PHC-TEST-OK-SHA256
47-
echo "PHC PASSED"
4836
49-
# Windows: build and test with the MSVC toolchain via build.ps1, which
50-
# builds tests.exe and phc-test.exe, runs them, and verifies output
51-
# against TESTS-OK / PHC-TEST-OK-SHA256, exiting non-zero on mismatch.
52-
# shell: powershell uses Windows PowerShell 5.1 (shipped with Windows)
53-
# rather than PowerShell 7, verifying 5.1 compatibility.
37+
# Windows: build and test with the MSVC toolchain via build.ps1. The
38+
# "check" target builds tests.exe and phc-test.exe, runs them, and
39+
# verifies their output against TESTS-OK / PHC-TEST-OK-SHA256
5440
- name: Build and test (Windows)
5541
if: runner.os == 'Windows'
5642
shell: powershell

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ all: $(PROJ)
4242
check: tests phc-test
4343
@echo 'Running main tests'
4444
@time ./tests | tee TESTS-OUT
45-
@diff -U0 TESTS-OK TESTS-OUT && echo PASSED || echo FAILED
45+
@diff -U0 TESTS-OK TESTS-OUT && echo PASSED || { echo FAILED; exit 1; }
4646
@if [ -f PHC-TEST-OK-SHA256 ]; then \
4747
echo 'Running PHC tests'; \
4848
time ./phc-test > PHC-TEST-OUT; \

build.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
#requires -Version 5.1
22
<#
3+
.COPYRIGHT
4+
Copyright 2013-2026 Alexander Peslyak
5+
Copyright 2026 CPUchain
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without
9+
modification, are permitted.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
12+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
13+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
14+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
16+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
17+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
20+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21+
SUCH DAMAGE.
22+
323
.SYNOPSIS
424
Build yescrypt with the MSVC toolchain (port of the supplied GNU Makefile).
525

0 commit comments

Comments
 (0)