simple refactor to reduce PRs CI load (#3701)

* add discord notification in ci-daily
This commit is contained in:
Ivan FB 2026-01-29 15:48:34 +01:00 committed by GitHub
parent a02aaab53c
commit 74b19c05d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 90 additions and 8 deletions

79
.github/workflows/ci-daily.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: Daily logos-messaging-nim CI
on:
schedule:
- cron: '30 6 * * *'
env:
NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC} --colors:off -d:chronicles_colors:none"
jobs:
build:
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: Get submodules hash
id: submodules
run: |
echo "hash=$(git submodule status | awk '{print $1}' | sort | shasum -a 256 | sed 's/[ -]*//g')" >> $GITHUB_OUTPUT
- name: Cache submodules
uses: actions/cache@v3
with:
path: |
vendor/
.git/modules
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
- name: Make update
run: make update
- name: Build binaries
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 examples tools
- name: Notify Discord
if: always()
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
STATUS="${{ job.status }}"
OS="${{ matrix.os }}"
REPO="${{ github.repository }}"
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
if [ "$STATUS" = "success" ]; then
COLOR=3066993
TITLE="✅ CI Success"
else
COLOR=15158332
TITLE="❌ CI Failed"
fi
curl -H "Content-Type: application/json" \
-X POST \
-d "{
\"embeds\": [{
\"title\": \"$TITLE\",
\"color\": $COLOR,
\"fields\": [
{\"name\": \"Repository\", \"value\": \"$REPO\", \"inline\": true},
{\"name\": \"OS\", \"value\": \"$OS\", \"inline\": true},
{\"name\": \"Status\", \"value\": \"$STATUS\", \"inline\": true}
],
\"url\": \"$RUN_URL\",
\"footer\": {\"text\": \"Daily logos-messaging-nim CI\"}
}]
}" \
"$DISCORD_WEBHOOK_URL"

View File

@ -80,7 +80,7 @@ jobs:
run: make update
- name: Build binaries
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all tools
run: make V=1 QUICK_AND_DIRTY_COMPILER=1 all
build-windows:
needs: changes

View File

@ -51,10 +51,12 @@ endif
##########
## Main ##
##########
.PHONY: all test update clean
.PHONY: all test update clean examples
# default target, because it's the first one that doesn't start with '.'
all: | wakunode2 example2 chat2 chat2bridge libwaku
all: | wakunode2 libwaku
examples: | example2 chat2 chat2bridge
test_file := $(word 2,$(MAKECMDGOALS))
define test_name

View File

@ -8,7 +8,8 @@ import
libp2p/peerid,
metrics,
ffi
import waku/factory/waku, waku/node/waku_node, waku/node/health_monitor, library/declare_lib
import
waku/factory/waku, waku/node/waku_node, waku/node/health_monitor, library/declare_lib
proc getMultiaddresses(node: WakuNode): seq[string] =
return node.info().listenAddresses

View File

@ -217,7 +217,8 @@ suite "Waku Filter - DOS protection":
for fut in finished:
check not fut.failed()
let pingRes = fut.read()
if pingRes.isErr() and pingRes.error().kind == FilterSubscribeErrorKind.TOO_MANY_REQUESTS:
if pingRes.isErr() and
pingRes.error().kind == FilterSubscribeErrorKind.TOO_MANY_REQUESTS:
gotTooMany = true
break

View File

@ -122,9 +122,8 @@ suite "Rate limited push service":
# ensure period of time has passed and the client can again use the service
await sleepAsync(tokenPeriod + 100.millis)
let recoveryRes = await client.publish(
some(DefaultPubsubTopic), fakeWakuMessage(), serverPeerId
)
let recoveryRes =
await client.publish(some(DefaultPubsubTopic), fakeWakuMessage(), serverPeerId)
check recoveryRes.isOk()
## Cleanup