mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-07-30 03:53:28 +00:00
* Add in-repo API/e2e test suite (tests-e2e) Migrate the liblogosdelivery API/wrapper pytest suite into tests-e2e/ and run it in CI (e2e-api-tests.yml) against the built library. Edge senders use the real lightpush path (relay=False). * ci: run docker subset of the API/e2e wrapper tests Parametrize e2e-api-tests.yml with `subset` (non-docker|docker) and `node_image` inputs, and add a send-api-e2e-docker-tests job that runs the docker_required wrapper tests (S19/S20/S31) against the built node image. The docker job needs both the liblogosdelivery artifact and the container-image build, and skips when no image is available (fork PRs lack the registry secrets). The non-docker subset still needs only `build`, so a docker-image build failure cannot mask its result. * ci: run docker e2e subset on fork PRs against a pinned public image Drop the gate that skipped the docker subset when no PR-built node image is available. Fork PRs lack the quay secrets, so build-docker-image succeeds with an empty output and the subset now falls back to DEFAULT_NWAKU instead of being skipped. Pin DEFAULT_NWAKU to wakuorg/nwaku:v0.38.1. The rolling :latest tag is a daily upstream master build and currently fails to boot with "updateAddressInENR: Public key does not correspond with given private key", which would have made the subset permanently red on fork PRs. s31 passes against v0.38.1 and against the PR-built image. Echo the resolved peer image at the start of the test step. The job name is left static so the check can still be made required.
279 lines
9.2 KiB
YAML
279 lines
9.2 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
NPROC: 2
|
|
MAKEFLAGS: "-j${NPROC}"
|
|
NIMFLAGS: "--parallelBuild:${NPROC} --colors:off -d:chronicles_colors:none -d:disableMarchNative"
|
|
NIM_PARAMS: "-d:disableMarchNative"
|
|
NIM_VERSION: '2.2.4'
|
|
NIMBLE_VERSION: '0.22.3'
|
|
|
|
jobs:
|
|
changes: # changes detection
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
pull-requests: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
name: Checkout code
|
|
id: checkout
|
|
- uses: dorny/paths-filter@v2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
common:
|
|
- '.github/workflows/**'
|
|
- 'nimble.lock'
|
|
- 'logos_delivery.nimble'
|
|
- 'Makefile'
|
|
- 'scripts/**'
|
|
- 'flake.nix'
|
|
- 'flake.lock'
|
|
- 'library/**'
|
|
v2:
|
|
- 'logos_delivery/**'
|
|
- 'apps/**'
|
|
- 'tools/**'
|
|
- 'tests/all_tests_v2.nim'
|
|
- 'tests/**'
|
|
- 'tests-e2e/**'
|
|
docker:
|
|
- 'docker/**'
|
|
|
|
outputs:
|
|
common: ${{ steps.filter.outputs.common }}
|
|
v2: ${{ steps.filter.outputs.v2 }}
|
|
docker: ${{ steps.filter.outputs.docker }}
|
|
|
|
build:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-22.04, macos-15]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 45
|
|
|
|
name: build-${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim ${{ env.NIM_VERSION }}
|
|
uses: jiro4989/setup-nim-action@v2
|
|
with:
|
|
nim-version: ${{ env.NIM_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
|
|
run: |
|
|
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
|
|
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
|
|
|
|
- name: Cache nimble deps
|
|
id: cache-nimbledeps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
nimbledeps/
|
|
nimble.paths
|
|
key: ${{ runner.os }}-nimbledeps-v2-nimble${{ env.NIMBLE_VERSION }}-${{ hashFiles('nimble.lock', 'BearSSL.mk', 'Nat.mk') }}
|
|
|
|
- name: Install nimble deps
|
|
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
|
|
run: |
|
|
# nim's source tree checksums differently across platforms, so its
|
|
# locked checksum is unreliable. --useSystemNim uses the CI nim and
|
|
# skips that check, while still verifying every other locked dep.
|
|
nimble setup --localdeps -y --useSystemNim
|
|
make rebuild-nat-libs-nimbledeps
|
|
make rebuild-bearssl-nimbledeps
|
|
touch nimbledeps/.nimble-setup
|
|
|
|
- name: Build binaries
|
|
# -j1: `all` builds wakunode2 and liblogosdelivery, each via `nimble
|
|
# <task>`. Under -j2 the two nimble invocations re-resolve git deps
|
|
# concurrently and clobber each other in the shared ~/.nimble/pkgcache
|
|
# (e.g. "destination already exists", "could not lock config file"),
|
|
# failing the build. Serializing the targets removes the race; Nim's
|
|
# own --parallelBuild still parallelizes compilation. Mirrors the test
|
|
# job, which already forces -j1.
|
|
run: make V=1 -j1 all
|
|
|
|
# Publish the freshly built shared library so the interop-tests workflow
|
|
# can run the wrapper suite against it without rebuilding. Only the Linux
|
|
# build is uploaded since the interop runners are ubuntu-latest.
|
|
- name: Upload liblogosdelivery.so
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: liblogosdelivery
|
|
path: build/liblogosdelivery.so
|
|
retention-days: 1
|
|
|
|
build-windows:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
|
uses: ./.github/workflows/windows-build.yml
|
|
with:
|
|
branch: ${{ github.ref }}
|
|
|
|
test:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-22.04, macos-15]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 60
|
|
|
|
name: test-${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim ${{ env.NIM_VERSION }}
|
|
uses: jiro4989/setup-nim-action@v2
|
|
with:
|
|
nim-version: ${{ env.NIM_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
|
|
run: |
|
|
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
|
|
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
|
|
|
|
- name: Cache nimble deps
|
|
id: cache-nimbledeps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
nimbledeps/
|
|
nimble.paths
|
|
key: ${{ runner.os }}-nimbledeps-v2-nimble${{ env.NIMBLE_VERSION }}-${{ hashFiles('nimble.lock', 'BearSSL.mk', 'Nat.mk') }}
|
|
|
|
- name: Install nimble deps
|
|
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
|
|
run: |
|
|
# nim's source tree checksums differently across platforms, so its
|
|
# locked checksum is unreliable. --useSystemNim uses the CI nim and
|
|
# skips that check, while still verifying every other locked dep.
|
|
nimble setup --localdeps -y --useSystemNim
|
|
make rebuild-nat-libs-nimbledeps
|
|
make rebuild-bearssl-nimbledeps
|
|
touch nimbledeps/.nimble-setup
|
|
|
|
- name: Run tests
|
|
run: |
|
|
postgres_enabled=0
|
|
if [ ${{ runner.os }} == "Linux" ]; then
|
|
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:15.4-alpine3.18
|
|
postgres_enabled=1
|
|
fi
|
|
|
|
export MAKEFLAGS="-j1"
|
|
export NIMFLAGS="--colors:off -d:chronicles_colors:none -d:disableMarchNative"
|
|
export USE_LIBBACKTRACE=0
|
|
|
|
make V=1 POSTGRES=$postgres_enabled test
|
|
make V=1 POSTGRES=$postgres_enabled testwakunode2
|
|
|
|
build-docker-image:
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' || needs.changes.outputs.docker == 'true' }}
|
|
uses: ./.github/workflows/container-image.yml
|
|
secrets: inherit
|
|
|
|
# Docker-based interop smoke tests. Gated only on the docker image so they
|
|
# still run on docker-only PRs (no liblogosdelivery build required).
|
|
nwaku-nwaku-interop-tests:
|
|
needs: build-docker-image
|
|
uses: logos-messaging/logos-delivery-interop-tests/.github/workflows/nim_waku_PR.yml@SMOKE_TEST_2026.06.25
|
|
with:
|
|
node_nwaku: ${{ needs.build-docker-image.outputs.image }}
|
|
|
|
secrets: inherit
|
|
|
|
# Send API E2E tests run the in-repo tests-e2e/ wrapper suite against the
|
|
# liblogosdelivery.so built by the `build` job (downloaded as the
|
|
# `liblogosdelivery` artifact). Gated on `build`, so it is skipped on
|
|
# docker-only PRs where no lib is built.
|
|
send-api-e2e-tests:
|
|
needs: build
|
|
uses: ./.github/workflows/e2e-api-tests.yml
|
|
with:
|
|
subset: non-docker
|
|
secrets: inherit
|
|
|
|
# Docker subset; an empty node_image falls back to DEFAULT_NWAKU (fork PRs lack the quay secrets).
|
|
send-api-e2e-docker-tests:
|
|
needs: [build, build-docker-image]
|
|
uses: ./.github/workflows/e2e-api-tests.yml
|
|
with:
|
|
subset: docker
|
|
node_image: ${{ needs.build-docker-image.outputs.image }}
|
|
secrets: inherit
|
|
|
|
lint:
|
|
name: "Lint"
|
|
runs-on: ubuntu-22.04
|
|
needs: build
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Nim ${{ env.NIM_VERSION }}
|
|
uses: jiro4989/setup-nim-action@v2
|
|
with:
|
|
nim-version: ${{ env.NIM_VERSION }}
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Install Nimble ${{ env.NIMBLE_VERSION }}
|
|
run: |
|
|
cd /tmp && nimble install "nimble@${{ env.NIMBLE_VERSION }}" -y
|
|
echo "$HOME/.nimble/bin" >> $GITHUB_PATH
|
|
|
|
- name: Cache nimble deps
|
|
id: cache-nimbledeps
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
nimbledeps/
|
|
nimble.paths
|
|
key: ${{ runner.os }}-nimbledeps-v2-nimble${{ env.NIMBLE_VERSION }}-${{ hashFiles('nimble.lock', 'BearSSL.mk', 'Nat.mk') }}
|
|
|
|
- name: Install nimble deps
|
|
if: steps.cache-nimbledeps.outputs.cache-hit != 'true'
|
|
run: |
|
|
# nim's source tree checksums differently across platforms, so its
|
|
# locked checksum is unreliable. --useSystemNim uses the CI nim and
|
|
# skips that check, while still verifying every other locked dep.
|
|
nimble setup --localdeps -y --useSystemNim
|
|
make rebuild-nat-libs-nimbledeps
|
|
make rebuild-bearssl-nimbledeps
|
|
touch nimbledeps/.nimble-setup
|
|
|
|
- name: Build nph
|
|
run: |
|
|
make build-nph
|
|
|
|
- name: Check nph formatting
|
|
run: |
|
|
shopt -s extglob # Enable extended globbing
|
|
NPH=$(make print-nph-path)
|
|
echo "using nph at ${NPH}"
|
|
"${NPH}" examples logos_delivery tests tools apps *.@(nim|nims|nimble)
|
|
git diff --exit-code
|