mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
Allow compile postgres tests only on Linux platforms (#1771)
This is needed because currently the GitHub Actions only supports starting a docker container in a Linux runners.
This commit is contained in:
parent
835a409d10
commit
fcd7f33d9b
9
.github/workflows/ci-experimental.yml
vendored
9
.github/workflows/ci-experimental.yml
vendored
@ -47,7 +47,6 @@ jobs:
|
|||||||
common: ${{ steps.filter.outputs.common }}
|
common: ${{ steps.filter.outputs.common }}
|
||||||
v2: ${{ steps.filter.outputs.v2 }}
|
v2: ${{ steps.filter.outputs.v2 }}
|
||||||
|
|
||||||
|
|
||||||
build-v2:
|
build-v2:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
||||||
@ -88,6 +87,7 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
|
|
||||||
name: test-v2-${{ matrix.os }}
|
name: test-v2-${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -106,4 +106,9 @@ jobs:
|
|||||||
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
|
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
|
run: |
|
||||||
|
if [ ${{ runner.os }} == "Linux" ]; then
|
||||||
|
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:9.6-alpine
|
||||||
|
fi
|
||||||
|
|
||||||
|
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
|
||||||
|
|||||||
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@ -56,7 +56,6 @@ jobs:
|
|||||||
v2: ${{ steps.filter.outputs.v2 }}
|
v2: ${{ steps.filter.outputs.v2 }}
|
||||||
legacy: ${{ steps.filter.outputs.legacy }}
|
legacy: ${{ steps.filter.outputs.legacy }}
|
||||||
|
|
||||||
|
|
||||||
build-v2:
|
build-v2:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
|
||||||
@ -115,8 +114,12 @@ jobs:
|
|||||||
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
|
key: ${{ runner.os }}-vendor-modules-${{ steps.submodules.outputs.hash }}
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
|
run: |
|
||||||
|
if [ ${{ runner.os }} == "Linux" ]; then
|
||||||
|
sudo docker run --rm -d -e POSTGRES_PASSWORD=test123 -p 5432:5432 postgres:9.6-alpine
|
||||||
|
fi
|
||||||
|
|
||||||
|
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test2 testwakunode2
|
||||||
|
|
||||||
build-legacy:
|
build-legacy:
|
||||||
needs: changes
|
needs: changes
|
||||||
|
|||||||
2
Makefile
2
Makefile
@ -175,7 +175,7 @@ testcommon: | build deps
|
|||||||
|
|
||||||
testwaku2: | build deps librln
|
testwaku2: | build deps librln
|
||||||
echo -e $(BUILD_MSG) "build/$@" && \
|
echo -e $(BUILD_MSG) "build/$@" && \
|
||||||
$(ENV_SCRIPT) nim test2 $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
|
$(ENV_SCRIPT) nim test2 -d:os=$(shell uname) $(NIM_PARAMS) $(EXPERIMENTAL_PARAMS) waku.nims
|
||||||
|
|
||||||
wakunode2: | build deps librln
|
wakunode2: | build deps librln
|
||||||
echo -e $(BUILD_MSG) "build/$@" && \
|
echo -e $(BUILD_MSG) "build/$@" && \
|
||||||
|
|||||||
@ -19,9 +19,12 @@ import
|
|||||||
./v2/waku_archive/test_retention_policy,
|
./v2/waku_archive/test_retention_policy,
|
||||||
./v2/waku_archive/test_waku_archive
|
./v2/waku_archive/test_waku_archive
|
||||||
|
|
||||||
# TODO: add the postgres test when we can mock the database.
|
const os* {.strdefine.} = ""
|
||||||
# The postgres tests now need a running postgresql database running locally.
|
when os == "Linux":
|
||||||
# ./v2/waku_archive/test_driver_postgres,
|
# GitHub only supports container actions on Linux
|
||||||
|
# and we need to start a postgress database in a docker container
|
||||||
|
import
|
||||||
|
./v2/waku_archive/test_driver_postgres
|
||||||
|
|
||||||
# Waku store test suite
|
# Waku store test suite
|
||||||
import
|
import
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: postgres:9.6-alpine
|
image: postgres:9.6-alpine
|
||||||
Loading…
x
Reference in New Issue
Block a user