ci: merge test1 and tes2 github workflows

This commit is contained in:
Lorenzo Delgado 2022-12-01 14:33:59 +01:00 committed by GitHub
parent 0f91f97a9a
commit 39a2b5f283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 302 additions and 326 deletions

122
.github/workflows/ci-experimental.yml vendored Normal file
View File

@ -0,0 +1,122 @@
name: experimental
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}"
EXPERIMENTAL: "true"
jobs:
changes: # changes detection
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
common:
- '.github/workflows/**'
- 'vendor/**'
- 'Makefile'
- 'waku.nimble'
v2:
- 'waku/common/**'
- 'waku/v2/**'
- 'apps/**'
- 'tools/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'
outputs:
common: ${{ steps.filter.outputs.common }}
v2: ${{ steps.filter.outputs.v2 }}
build-v2:
needs: changes
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: build-v2-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodule versions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
echo "zerokit-hash=$(git rev-parse HEAD:vendor/zerokit)" >> $GITHUB_OUTPUT
- name: Cache nim compiler
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Cache zerokit artifacts
uses: actions/cache@v3
with:
path: vendor/zerokit/target/release
key: ${{ runner.os }}-zerokit-${{ steps.submodules.outputs.zerokit-hash }}
- name: Build binaries
run: make V=1 LOG_LEVEL=TRACE v2
test-v2:
needs: changes
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: test-v2-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodule versions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
echo "zerokit-hash=$(git rev-parse HEAD:vendor/zerokit)" >> $GITHUB_OUTPUT
- name: Cache nim compiler
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Cache zerokit artifacts
uses: actions/cache@v3
with:
path: vendor/zerokit/target/release
key: ${{ runner.os }}-zerokit-${{ steps.submodules.outputs.zerokit-hash }}
- name: Run tests
run: make V=1 LOG_LEVEL=TRACE test2

180
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,180 @@
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}"
jobs:
changes: # changes detection
runs-on: ubuntu-latest
permissions:
pull-requests: read
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
common:
- '.github/workflows/**'
- 'vendor/**'
- 'Makefile'
- 'waku.nimble'
v2:
- 'waku/common/**'
- 'waku/v2/**'
- 'apps/**'
- 'tools/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'
legacy:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'
- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'
outputs:
common: ${{ steps.filter.outputs.common }}
v2: ${{ steps.filter.outputs.v2 }}
legacy: ${{ steps.filter.outputs.legacy }}
build-v2:
needs: changes
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: build-v2-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodules versions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Build binaries
run: make V=1 LOG_LEVEL=TRACE v2
test-v2:
needs: changes
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: test-v2-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodules versions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Run tests
run: make V=1 LOG_LEVEL=TRACE test2
build-legacy:
needs: changes
if: ${{ needs.changes.outputs.legacy == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: build-legacy-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodule versions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Build binaries
run: make V=1 LOG_LEVEL=TRACE v1
test-legacy:
needs: changes
if: ${{ needs.changes.outputs.legacy == 'true' || needs.changes.outputs.common == 'true' }}
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
name: test-legacy-${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Get submodule vesions
id: submodules
shell: bash
run: |
echo "nim-hash=$(git rev-parse HEAD:vendor/nimbus-build-system)" >> $GITHUB_OUTPUT
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-nim-${{ steps.submodules.outputs.nim-hash }}
- name: Run tests
run: make V=1 LOG_LEVEL=TRACE test1

View File

@ -1,37 +0,0 @@
name: test1
on:
pull_request:
paths:
- 'waku/v2/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- run: 'echo "No test required"'

View File

@ -1,66 +0,0 @@
name: test1
on:
pull_request:
paths-ignore:
- 'waku/v2/**'
- 'tests/all_tests_v2.nim'
- 'tests/v2/**'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
env:
- NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC}"
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
timeout-minutes: 60
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
# We need to do this because of how github cache works
# I am not sure we can move the cache file, so if we do not do this
# make update breaks because the cached compiler is there where the submodules
# are meant to go.
- name: Submodules
run: git submodule update --init --recursive
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}
- name: Update dependencies
run: make V=1 update
- name: Build V1 binaries
run: make LOG_LEVEL=TRACE v1
- name: Run V1 Tests
run: make test1

View File

@ -1,41 +0,0 @@
name: test2-experimental
on:
pull_request:
paths:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'
- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- run: 'echo "No test required"'

View File

@ -1,71 +0,0 @@
name: test2-experimental
on:
pull_request:
paths-ignore:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'
- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
env:
- NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC}"
EXPERIMENTAL: "true"
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
timeout-minutes: 60
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
# We need to do this because of how github cache works
# I am not sure we can move the cache file, so if we do not do this
# make update breaks because the cached compiler is there where the submodules
# are meant to go.
- name: Submodules
run: git submodule update --init --recursive
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}
- name: Update dependencies
run: make V=1 update
- name: Build V2 binaries
run: make LOG_LEVEL=TRACE v2
- name: Run V2 Tests
run: make test2

View File

@ -1,41 +0,0 @@
name: test2
on:
pull_request:
paths:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'
- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- run: 'echo "No test required"'

View File

@ -1,70 +0,0 @@
name: test2
on:
pull_request:
paths-ignore:
- 'waku/v1/**'
- 'tests/all_tests_v1.nim'
- 'tests/v1/**'
- 'waku/whisper/**'
- 'tests/whisper/**'
- 'tests/all_tests_whisper.nim'
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
push:
branches:
- master
paths-ignore:
- 'ci/**'
- 'metrics/**'
- 'docs/**'
- '**.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
env:
- NPROC: 2
MAKEFLAGS: "-j${NPROC}"
NIMFLAGS: "--parallelBuild:${NPROC}"
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
env: ${{ matrix.env }}
timeout-minutes: 60
name: ${{ github.workflow }}-${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
# We need to do this because of how github cache works
# I am not sure we can move the cache file, so if we do not do this
# make update breaks because the cached compiler is there where the submodules
# are meant to go.
- name: Submodules
run: git submodule update --init --recursive
- name: Cache nim
uses: actions/cache@v3
with:
path: vendor/nimbus-build-system/vendor/Nim/bin
key: ${{ runner.os }}-${{ matrix.env.NPROC }}-nim-${{ hashFiles('.gitmodules') }}
- name: Update dependencies
run: make V=1 update
- name: Build V2 binaries
run: make LOG_LEVEL=TRACE v2
- name: Run V2 Tests
run: make test2