Skip to content

ci: add GitHub Actions build matrix and reader-free tests - #1

Merged
maksimtech merged 4 commits into
masterfrom
ci/software-tests
Oct 22, 2026
Merged

maksimtech merged 4 commits into
masterfrom
ci/software-tests

Conversation

@maksimtech

Copy link
Copy Markdown
Owner

First step of maintaining this fork: nothing is built or tested automatically today (only a .travis.yml that no longer runs).

What

  • test/software/test_no_hardware.c, run by ctest with -DBUILD_SOFTWARE_TESTS=ON (default OFF). No NFC reader needed: CRC_A/CRC_B known answers (CRC catalogue check values + the ISO 14443-3 worked example), string converters, nfc_version(), and nfc_init/nfc_list_devices/nfc_open with no device configured.
  • .github/workflows/ci.yml: Linux CMake (gcc, clang), Linux autotools, macOS, Windows MinGW (MSYS2), plus an nfc-list smoke test.

TDD evidence (Ubuntu 24.04 container)

  • Red: test present, CMake not wired → No tests were found!!!, ctest exit 8.
  • Green: wired → 100% tests passed.
  • Mutations on the library are caught: CRC_A init 0x6363→0x6364 (3 checks fail), "ISO/IEC 14443A" string changed (1 fails), nfc_version() returning "" (1 fails).

🤖 Generated with Claude Code

maksimtech and others added 4 commits October 22, 2026 16:44
Add test/software/test_no_hardware.c, run by ctest when configured with
-DBUILD_SOFTWARE_TESTS=ON (default OFF, so packagers are unaffected). It
needs no NFC reader and checks:
- ISO 14443-3 CRC_A/CRC_B against the CRC catalogue check values and the
  worked example of the standard
- the string converters and nfc_version()
- nfc_init/nfc_list_devices/nfc_open without any device configured

The workflow builds and tests on Linux (CMake with gcc and clang,
autotools), macOS and Windows (MinGW via MSYS2), and smoke-tests nfc-list
with no reader attached. The Travis configuration no longer runs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CMake 4 removed compatibility with cmake_minimum_required below 3.5, so the
project no longer configures with it (seen on macOS CI runners). Configuring
with CMake 3.28 installs the same 51 files before and after this change;
with CMake 4.1 the configure error goes away and the reader-free tests pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Windows job reaches the compiler and fails in contrib/win32/stdlib.c
(char *str[32] passed to strcpy, nfc-tools#765). Keep it visible but
non-blocking until that fix is merged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@maksimtech
maksimtech merged commit 92e47e4 into master Oct 22, 2026
7 of 10 checks passed
@maksimtech
maksimtech deleted the ci/software-tests branch October 22, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant