Skip to content

add a GitHub Actions workflow to run tests on PRs - #94

Open
QuietMisdreavus wants to merge 12 commits into
gfmfrom
vgm/gha
Open

add a GitHub Actions workflow to run tests on PRs#94
QuietMisdreavus wants to merge 12 commits into
gfmfrom
vgm/gha

Conversation

@QuietMisdreavus

@QuietMisdreavus QuietMisdreavus commented Jun 29, 2026

Copy link
Copy Markdown

This is a first-brush attempt at adding PR checks to swift-cmark, based on the CommonMark test suite. Swift-cmark additions are tested in the api_test executable, but there are other tests inherited from CommonMark and GitHub-Flavored Markdown that are important to run as well. This workflow attempts to run both by defining separate jobs that run either make test (with a pre-build step to make sure make and CMake are installed) or swift run api_test, as swift test itself would fail due to having no test targets.

The workflow attempts to run the tests on the primary trio of macOS/Linux/Windows. If we want to add other platforms like FreeBSD or Android in the future, we'll need to do something similar with their build commands, but it should be relatively straightforward to adapt them based on the existing platforms.

@QuietMisdreavus

Copy link
Copy Markdown
Author

Dang, the Linux builder doesn't have make and the macOS builder doesn't have CMake. So i guess i can only fall back to api_test and not testing the CMake project files at all?

@snprajwal

Copy link
Copy Markdown

Dang, the Linux builder doesn't have make and the macOS builder doesn't have CMake. So i guess i can only fall back to api_test and not testing the CMake project files at all?

You can use a pre-build script to install the tools you need for running the full test suite :)

@QuietMisdreavus

Copy link
Copy Markdown
Author

I figured out how to use the prebuild scripts you linked and wired up a separate job for running make test based on the work-in-progress use of them in Swift-DocC from @shahmishal. With that added it looks like we're solid! All of the jobs seem to be passing for now. This PR just needs a validity pass from Mishal to make sure i'm using the workflows and runners correctly and we should be good to land it.

@QuietMisdreavus

Copy link
Copy Markdown
Author

It looks like GNU Make can't find the CMake executable in the Windows tests, and i'm not sure how to force that path to be available. I'm going to disable the Make tests on Windows for now since we can at least build the Swift package there.

Now the new checks should all work, and should be ready for review.

@snprajwal snprajwal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one Vera! LGTM

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.

2 participants