2026-07-07 11:52:46 +04:00

39 lines
1.1 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: "2.2.10"
- name: Install dependencies
run: nimble setup -y
- name: Unit tests
# same reason as integration tests: nimble exits with code 0 even on failure.
run: |
nim c -o:tests/test_plum tests/test_plum.nim
./tests/test_plum
- name: Integration tests
# we call docker directly instead of nimble testIntegration because nimble
# exits with code 0 even when exec() fails, which would make CI pass on failure.
run: |
docker build -t libplum -f tests/Dockerfile .
docker run --rm --cap-add=NET_ADMIN -e TEST_MINIUPNP_PCP=1 libplum
docker run --rm --cap-add=NET_ADMIN -e TEST_MINIUPNP_UPNP=1 libplum
docker run --rm --cap-add=NET_ADMIN -e TEST_MINIUPNP_NATPMP=1 libplum