https://github.com/bahmanm/prolog-etudes
A collection of etudes for folks new to Prolog (and sometimes experienced ones) to learn the language in a practical fashion.
https://github.com/bahmanm/prolog-etudes
ci-cd circleci codecov learning-exercise prolog swi-prolog
Last synced: 4 months ago
JSON representation
A collection of etudes for folks new to Prolog (and sometimes experienced ones) to learn the language in a practical fashion.
- Host: GitHub
- URL: https://github.com/bahmanm/prolog-etudes
- Owner: bahmanm
- License: gpl-3.0
- Created: 2023-12-11T02:20:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-20T22:09:31.000Z (4 months ago)
- Last Synced: 2025-02-20T23:20:36.231Z (4 months ago)
- Topics: ci-cd, circleci, codecov, learning-exercise, prolog, swi-prolog
- Language: Prolog
- Homepage: https://matrix.to/#/#github-bahmanm-prolog-etudes:matrix.org
- Size: 71.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prolog-etudes
[](https://dl.circleci.com/status-badge/redirect/circleci/UMKeFZ8ns9T9vi5aquTfVT/GmMZi7fYoEtn4APsVdADde/tree/main)
[](https://codecov.io/gh/bahmanm/prolog-etudes)

[](https://matrix.to/#/#github-bahmanm-prolog-etudes:matrix.org)A collection of etudes for folks new to Prolog (and sometimes experienced ones) to learn the
language in a practical fashion.![]()
# How To Run/Test
Assuming you've got all the necessary tools installed (see below), all you'd need to is
```
$ make test...
% All 22 tests passed in 0.055 seconds (0.053 cpu)
```### Prerequisites
To run the tests all you need to do is a recent SWI-Prolog and the latest
[bmakelib](https://github.com/bahmanm/bmakelib).For example, on an openSUSE Tumbleweed machine:
```
# zypper refresh && zypper install swipl make
# rpm --install --nosignature https://github.com/bahmanm/bmakelib/releases/download/v0.7.0/bmakelib-0.7.0-1.1.noarch.rpm
```# CI Pipeline Setup
_I have used [CircleCI](https://circleci.com/) as the CI service for this project._
You can view the configuration at [.circleci/config.yml](https://github.com/bahmanm/prolog-etudes/blob/c7218f9c64ca430559629ce544aa25dfca53bfb6/.circleci/config.yml).
The highlights are:
* Line 8: [uses the bmakelib Docker image](https://github.com/bahmanm/prolog-etudes/blob/c7218f9c64ca430559629ce544aa25dfca53bfb6/.circleci/config.yml#L8)
from the [bdockerimg project](https://github.com/bahmanm/bdockerimg).
* Line 25: Install SWI-Prolog
* Line 31: Run the tests with the `test.produce-coverage-report=yes` option. This causes the Prolog report coverage files to be generated - more on this below.### Test Code Coverage Setup
I have opted to use [Codecov](https://about.codecov.io/) as the code coverage service. The integration with Github is quite easy and takes only a few steps.
If you look at [.circleci/config.yml](https://github.com/bahmanm/prolog-etudes/blob/c7218f9c64ca430559629ce544aa25dfca53bfb6/.circleci/config.yml) file again:
* Line 48 and 56: install the Codecov CLI tool
* Line 66: uses codecov-cli to upload the coverage reports to Codecov.However the problem is that none of the existing code coverage services, including Codecov, support the reports generated by Prolog.
To work around this, I wrote a small Perl program called [coverage-report-converter](bin/coverage-report-converter.pl) to parse the Prolog report and convert it to the format which is used by Go.
