mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
chore(ci): enable experimental for the PR image builds (#1976)
This commit is contained in:
parent
be48891f77
commit
1b835b4e2a
12
.github/workflows/ci-experimental.yml
vendored
12
.github/workflows/ci-experimental.yml
vendored
@ -42,9 +42,13 @@ jobs:
|
|||||||
- 'tests/all_tests_waku.nim'
|
- 'tests/all_tests_waku.nim'
|
||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
|
|
||||||
|
docker:
|
||||||
|
- 'docker/**'
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
common: ${{ steps.filter.outputs.common }}
|
common: ${{ steps.filter.outputs.common }}
|
||||||
v2: ${{ steps.filter.outputs.v2 }}
|
v2: ${{ steps.filter.outputs.v2 }}
|
||||||
|
docker: ${{ steps.filter.outputs.docker }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: changes
|
needs: changes
|
||||||
@ -116,3 +120,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test testwakunode2
|
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 test testwakunode2
|
||||||
|
|
||||||
|
build-docker-image:
|
||||||
|
needs: changes
|
||||||
|
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' || needs.changes.outputs.docker == 'true' }}
|
||||||
|
uses: waku-org/nwaku/.github/workflows/container-image.yml@master
|
||||||
|
with:
|
||||||
|
experimental: true
|
||||||
|
secrets: inherit
|
||||||
|
|||||||
61
.github/workflows/ci.yml
vendored
61
.github/workflows/ci.yml
vendored
@ -41,9 +41,13 @@ jobs:
|
|||||||
- 'tests/all_tests_v2.nim'
|
- 'tests/all_tests_v2.nim'
|
||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
|
|
||||||
|
docker:
|
||||||
|
- 'docker/**'
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
common: ${{ steps.filter.outputs.common }}
|
common: ${{ steps.filter.outputs.common }}
|
||||||
v2: ${{ steps.filter.outputs.v2 }}
|
v2: ${{ steps.filter.outputs.v2 }}
|
||||||
|
docker: ${{ steps.filter.outputs.docker }}
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: changes
|
needs: changes
|
||||||
@ -117,57 +121,6 @@ jobs:
|
|||||||
|
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
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' || needs.changes.outputs.docker == 'true' }}
|
||||||
strategy:
|
uses: waku-org/nwaku/.github/workflows/container-image.yml@master
|
||||||
matrix:
|
secrets: inherit
|
||||||
os: [ubuntu-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
timeout-minutes: 60
|
|
||||||
|
|
||||||
name: docker-build-${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- 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: Build binaries
|
|
||||||
id: build
|
|
||||||
run: |
|
|
||||||
make -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative" wakunode2
|
|
||||||
|
|
||||||
TAG=$([ "${PR_NUMBER}" == "" ] && echo "master" || echo "${PR_NUMBER}")
|
|
||||||
IMAGE=quay.io/wakuorg/nwaku-pr:${TAG}
|
|
||||||
|
|
||||||
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
docker login -u ${QUAY_USER} -p ${QUAY_PASSWORD} quay.io
|
|
||||||
docker build -t ${IMAGE} -f docker/binaries/Dockerfile.bn.amd64 --label quay.expires-after=7d .
|
|
||||||
docker push ${IMAGE}
|
|
||||||
env:
|
|
||||||
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
|
|
||||||
QUAY_USER: ${{ secrets.QUAY_USER }}
|
|
||||||
PR_NUMBER: ${{ github.event.number }}
|
|
||||||
|
|
||||||
- name: Comment PR
|
|
||||||
uses: thollander/actions-comment-pull-request@v2
|
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
|
||||||
with:
|
|
||||||
message: |
|
|
||||||
You can find the image built from this PR at
|
|
||||||
|
|
||||||
```
|
|
||||||
${{steps.build.outputs.image}}
|
|
||||||
```
|
|
||||||
comment_tag: execution
|
|
||||||
|
|||||||
71
.github/workflows/container-image.yml
vendored
Normal file
71
.github/workflows/container-image.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: container-image-build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
experimental:
|
||||||
|
type: boolean
|
||||||
|
|
||||||
|
env:
|
||||||
|
NPROC: 2
|
||||||
|
MAKEFLAGS: "-j${NPROC}"
|
||||||
|
NIMFLAGS: "--parallelBuild:${NPROC}"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker-image:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
|
name: docker-build-${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- 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: Build binaries
|
||||||
|
id: build
|
||||||
|
run: |
|
||||||
|
EXPERIMENTAL=${{ inputs.experimental }}
|
||||||
|
|
||||||
|
make -j${NPROC} V=1 QUICK_AND_DIRTY_COMPILER=1 NIMFLAGS="-d:disableMarchNative" wakunode2 EXPERIMENTAL=${{EXPERIMENTAL}}
|
||||||
|
|
||||||
|
TAG=$([ "${PR_NUMBER}" == "" ] && echo "master" || echo "${PR_NUMBER}")
|
||||||
|
TAG=$([ "${EXPERIMENTAL}" == "true" ] && echo "${TAG}-experimental" || echo "${TAG}")
|
||||||
|
IMAGE=quay.io/wakuorg/nwaku-pr:${TAG}
|
||||||
|
|
||||||
|
echo "image=${IMAGE}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
docker login -u ${QUAY_USER} -p ${QUAY_PASSWORD} quay.io
|
||||||
|
docker build -t ${IMAGE} -f docker/binaries/Dockerfile.bn.amd64 --label quay.expires-after=7d .
|
||||||
|
docker push ${IMAGE}
|
||||||
|
env:
|
||||||
|
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
|
||||||
|
QUAY_USER: ${{ secrets.QUAY_USER }}
|
||||||
|
PR_NUMBER: ${{ github.event.number }}
|
||||||
|
|
||||||
|
- name: Comment PR
|
||||||
|
uses: thollander/actions-comment-pull-request@v2
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
with:
|
||||||
|
message: |
|
||||||
|
You can find the ${{ inputs.experimental && '**experimental**' || ''}} image built from this PR at
|
||||||
|
|
||||||
|
```
|
||||||
|
${{steps.build.outputs.image}}
|
||||||
|
```
|
||||||
|
comment_tag: execution${{ inputs.experimental && '**experimental**' || ''}}
|
||||||
Loading…
x
Reference in New Issue
Block a user