From 36c29989f619f2997ac494c57d920d8627fc516d Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 5 Jun 2024 22:25:14 +0200 Subject: [PATCH 01/70] wip --- .../{daily_common.yml => base_daily.yml} | 51 ++++++++++++++----- .github/workflows/bumper.yml | 3 +- .github/workflows/ci.yml | 2 +- .github/workflows/codecov.yml | 7 ++- .github/workflows/daily.yml | 20 +++++++- .github/workflows/daily_i386.yml | 13 ----- .github/workflows/daily_nim_devel.yml | 12 ----- 7 files changed, 63 insertions(+), 45 deletions(-) rename .github/workflows/{daily_common.yml => base_daily.yml} (63%) delete mode 100644 .github/workflows/daily_i386.yml delete mode 100644 .github/workflows/daily_nim_devel.yml diff --git a/.github/workflows/daily_common.yml b/.github/workflows/base_daily.yml similarity index 63% rename from .github/workflows/daily_common.yml rename to .github/workflows/base_daily.yml index e6a56ae402..b9677e3721 100644 --- a/.github/workflows/daily_common.yml +++ b/.github/workflows/base_daily.yml @@ -1,6 +1,10 @@ -name: daily-common +name: Daily on: + push: + branches: + - master + pull_request: workflow_call: inputs: nim-branch: @@ -17,30 +21,46 @@ on: type: string default: "[]" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: delete-cache: runs-on: ubuntu-latest steps: - uses: snnaplab/delete-branch-cache-action@v1 - build: + test: needs: delete-cache - timeout-minutes: 120 + timeout-minutes: 90 strategy: fail-fast: false matrix: platform: - os: linux builder: ubuntu-22.04 + cpu: amd64 + shell: bash + - os: linux + builder: ubuntu-22.04 + cpu: i386 shell: bash - os: macos builder: macos-13 + cpu: amd64 shell: bash - os: windows builder: windows-2022 + cpu: amd64 shell: msys2 {0} - branch: ${{ fromJSON(inputs.nim-branch) }} - cpu: ${{ fromJSON(inputs.cpu) }} + # - os: windows + # builder: windows-2019 + # cpu: i386 + # shell: msys2 {0} + nim-branch: + - version-1-6 + - version-2-0 exclude: ${{ fromJSON(inputs.exclude) }} defaults: @@ -49,18 +69,20 @@ jobs: name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.branch }})' runs-on: ${{ matrix.platform.builder }} - continue-on-error: ${{ matrix.branch == 'devel' || matrix.branch == 'version-2-0' }} + continue-on-error: ${{ matrix.nim-branch == 'version-2-0' }} steps: - name: Checkout uses: actions/checkout@v4 + with: + submodules: true - name: Setup Nim uses: "./.github/actions/install_nim" with: os: ${{ matrix.platform.os }} shell: ${{ matrix.platform.shell }} - nim_branch: ${{ matrix.branch }} - cpu: ${{ matrix.cpu }} + nim_branch: ${{ matrix.nim-branch }} + cpu: ${{ matrix.platform.cpu }} - name: Setup Go uses: actions/setup-go@v4 @@ -71,14 +93,15 @@ jobs: - name: Install p2pd run: | V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 + + - name: Install deps + run: | + nimble install -y --depsOnly - name: Run tests run: | nim --version nimble --version - nimble install -y --depsOnly - NIMFLAGS="${NIMFLAGS} --mm:refc" nimble test - if [[ "${{ matrix.branch }}" == "devel" ]]; then - echo -e "\nTesting with '--mm:orc':\n" - NIMFLAGS="${NIMFLAGS} --mm:orc" nimble test - fi + # --mm:orc | Should we run tests with ORC instead? + NIMFLAGS="${NIMFLAGS} --mm:refc" + nimble test diff --git a/.github/workflows/bumper.yml b/.github/workflows/bumper.yml index 14d5026eba..246c71f039 100644 --- a/.github/workflows/bumper.yml +++ b/.github/workflows/bumper.yml @@ -1,4 +1,4 @@ -name: Bumper +name: Dependency Bumper on: push: branches: @@ -8,6 +8,7 @@ on: jobs: bumpProjects: runs-on: ubuntu-latest + name: Bump version on ${{ matrix.target.repo }}:${{ matrix.target.branch }} strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66ec97080c..42c130df76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - build: + test-all: timeout-minutes: 90 strategy: fail-fast: false diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 3c43efacb8..bcab01f06a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,4 +1,4 @@ -name: nim-libp2p codecov builds +name: Codecov on: #On push to common branches, this computes the "bases stats" for PRs @@ -6,6 +6,8 @@ on: branches: - master pull_request: + branches: + - master workflow_dispatch: concurrency: @@ -13,7 +15,8 @@ concurrency: cancel-in-progress: true jobs: - Coverage: + coverage: + name: Run coverage and upload to codecov runs-on: ubuntu-22.04 env: CICOV: YES diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 572b0e5548..da50323fc3 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -1,4 +1,4 @@ -name: Daily +name: Daily Tests on: schedule: - cron: "30 6 * * *" @@ -6,7 +6,23 @@ on: jobs: call-multi-nim-common: - uses: ./.github/workflows/daily_common.yml + name: Daily amd64 + uses: ./.github/workflows/base_daily.yml with: nim-branch: "['version-1-6','version-2-0']" cpu: "['amd64']" + + call-multi-nim-common: + name: Daily i386 + uses: ./.github/workflows/base_daily.yml + with: + nim-branch: "['version-1-6','version-2-0', 'devel']" + cpu: "['i386']" + exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" + + call-multi-nim-common: + name: Daily Nim Devel + uses: ./.github/workflows/base_daily.yml + with: + nim-branch: "['devel']" + cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml deleted file mode 100644 index 23aa075971..0000000000 --- a/.github/workflows/daily_i386.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Daily i386 -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - -jobs: - call-multi-nim-common: - uses: ./.github/workflows/daily_common.yml - with: - nim-branch: "['version-1-6','version-2-0', 'devel']" - cpu: "['i386']" - exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" diff --git a/.github/workflows/daily_nim_devel.yml b/.github/workflows/daily_nim_devel.yml deleted file mode 100644 index d27ae5f1ea..0000000000 --- a/.github/workflows/daily_nim_devel.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Daily Nim Devel -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - -jobs: - call-multi-nim-common: - uses: ./.github/workflows/daily_common.yml - with: - nim-branch: "['devel']" - cpu: "['amd64']" From e5b11a5747f7c8379232184205056d27b823eccc Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 15:38:22 +0200 Subject: [PATCH 02/70] Deduplicate workflows, cleaner naming --- .../{base_daily.yml => base_tests.yml} | 44 +++++++++++++------ .../workflows/{codecov.yml => coverage.yml} | 7 +-- .github/workflows/daily.yml | 25 +++++------ .../{bumper.yml => dependencies.yml} | 8 ++-- .../workflows/{doc.yml => documentation.yml} | 2 +- .github/workflows/interop.yml | 2 +- 6 files changed, 52 insertions(+), 36 deletions(-) rename .github/workflows/{base_daily.yml => base_tests.yml} (68%) rename .github/workflows/{codecov.yml => coverage.yml} (90%) rename .github/workflows/{bumper.yml => dependencies.yml} (80%) rename .github/workflows/{doc.yml => documentation.yml} (98%) diff --git a/.github/workflows/base_daily.yml b/.github/workflows/base_tests.yml similarity index 68% rename from .github/workflows/base_daily.yml rename to .github/workflows/base_tests.yml index b9677e3721..6f05307312 100644 --- a/.github/workflows/base_daily.yml +++ b/.github/workflows/base_tests.yml @@ -1,4 +1,4 @@ -name: Daily +name: Base Tests on: push: @@ -7,14 +7,11 @@ on: pull_request: workflow_call: inputs: - nim-branch: - description: 'Nim branch' - required: true - type: string - cpu: - description: 'CPU' - required: true + include: + description: 'Include matrix configurations' + required: false type: string + default: "[]" exclude: description: 'Exclude matrix configurations' required: false @@ -26,13 +23,13 @@ concurrency: cancel-in-progress: true jobs: - delete-cache: + delete_cache: runs-on: ubuntu-latest steps: - uses: snnaplab/delete-branch-cache-action@v1 test: - needs: delete-cache + needs: delete_cache timeout-minutes: 90 strategy: fail-fast: false @@ -54,13 +51,10 @@ jobs: builder: windows-2022 cpu: amd64 shell: msys2 {0} - # - os: windows - # builder: windows-2019 - # cpu: i386 - # shell: msys2 {0} nim-branch: - version-1-6 - version-2-0 + include: ${{ fromJSON(inputs.include) }} exclude: ${{ fromJSON(inputs.exclude) }} defaults: @@ -105,3 +99,25 @@ jobs: # --mm:orc | Should we run tests with ORC instead? NIMFLAGS="${NIMFLAGS} --mm:refc" nimble test + + lint: + name: "Lint" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base + + - name: Check nph formatting + # Pin nph to a specific version to avoid sudden style differences. + # Updating nph version should be accompanied with running the new + # version on the fluffy directory. + run: | + VERSION="v0.5.1" + ARCHIVE="nph-linux_x64.tar.gz" + curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} + tar -xzf ${ARCHIVE} + shopt -s extglob # Enable extended globbing + ./nph examples libp2p tests tools *.@(nim|nims|nimble) + git diff --exit-code diff --git a/.github/workflows/codecov.yml b/.github/workflows/coverage.yml similarity index 90% rename from .github/workflows/codecov.yml rename to .github/workflows/coverage.yml index bcab01f06a..fdd523cdfe 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,7 @@ -name: Codecov +name: Coverage on: - #On push to common branches, this computes the "bases stats" for PRs + # On push to common branches, this computes the coverage PRs will compared against push: branches: - master @@ -15,7 +15,8 @@ concurrency: cancel-in-progress: true jobs: - coverage: + codecov: + # Improvement: Split single job into run tests, generate coverage, and upload to codecov. name: Run coverage and upload to codecov runs-on: ubuntu-22.04 env: diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index da50323fc3..446a0bdd1f 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,24 +5,21 @@ on: workflow_dispatch: jobs: - call-multi-nim-common: + test_amd64: name: Daily amd64 - uses: ./.github/workflows/base_daily.yml + uses: ./.github/workflows/base_tests.yml with: - nim-branch: "['version-1-6','version-2-0']" - cpu: "['amd64']" + exclude: "[{'platform': {'cpu': 'amd64'}}]" - call-multi-nim-common: + test_i386: name: Daily i386 - uses: ./.github/workflows/base_daily.yml + uses: ./.github/workflows/base_tests.yml with: - nim-branch: "['version-1-6','version-2-0', 'devel']" - cpu: "['i386']" - exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" + exclude: "[{'platform': {'cpu': 'i386'}}]" - call-multi-nim-common: - name: Daily Nim Devel - uses: ./.github/workflows/base_daily.yml + test_nim_devel: + name: Daily + uses: ./.github/workflows/base_tests.yml with: - nim-branch: "['devel']" - cpu: "['amd64']" + include: "[{'nim-branch': ['devel']}]" + exclude: "[{'platform': {'os': 'linux', 'cpu': 'amd64'}}]" diff --git a/.github/workflows/bumper.yml b/.github/workflows/dependencies.yml similarity index 80% rename from .github/workflows/bumper.yml rename to .github/workflows/dependencies.yml index 246c71f039..f7ed27ca10 100644 --- a/.github/workflows/bumper.yml +++ b/.github/workflows/dependencies.yml @@ -1,4 +1,4 @@ -name: Dependency Bumper +name: Update this project's version where it servers as a dependency on: push: branches: @@ -6,9 +6,10 @@ on: workflow_dispatch: jobs: - bumpProjects: + update_version: + # Is this job necessary? runs-on: ubuntu-latest - name: Bump version on ${{ matrix.target.repo }}:${{ matrix.target.branch }} + name: Updating version on ${{ matrix.target.repo }}:${{ matrix.target.branch }} strategy: fail-fast: false matrix: @@ -35,6 +36,7 @@ jobs: git checkout $GITHUB_SHA - name: Commit this bump + # Is it mandatory to create a new commit? Or does it exist as a way to communicate why the version was updated. run: | cd nbc git config --global user.email "${{ github.actor }}@users.noreply.github.com" diff --git a/.github/workflows/doc.yml b/.github/workflows/documentation.yml similarity index 98% rename from .github/workflows/doc.yml rename to .github/workflows/documentation.yml index 42f6a88375..489e137e00 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,4 @@ -name: Docgen +name: Documentation generation and publishing on: push: branches: diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 90cc5fb849..c9a6853626 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -1,4 +1,4 @@ -name: Interoperability Testing +name: Interoperability Tests on: pull_request: push: From 08bff892edb4ba2eee9a37a8a17cbd8e6df3c657 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 16:10:52 +0200 Subject: [PATCH 03/70] Fix empty include/exclude on workflow --- .github/workflows/base_tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 6f05307312..15fe45acdc 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -24,6 +24,7 @@ concurrency: jobs: delete_cache: + name: Delete github action's branch cache runs-on: ubuntu-latest steps: - uses: snnaplab/delete-branch-cache-action@v1 @@ -54,8 +55,8 @@ jobs: nim-branch: - version-1-6 - version-2-0 - include: ${{ fromJSON(inputs.include) }} - exclude: ${{ fromJSON(inputs.exclude) }} + include: ${{ fromJSON(inputs.include) || [] }} + exclude: ${{ fromJSON(inputs.exclude) || [] }} defaults: run: From 95f20ef6983ecbd5bf34a089aa37e60fb07b54f0 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 16:13:10 +0200 Subject: [PATCH 04/70] Fix wrong json. --- .github/workflows/base_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 15fe45acdc..61eda085b3 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -55,8 +55,8 @@ jobs: nim-branch: - version-1-6 - version-2-0 - include: ${{ fromJSON(inputs.include) || [] }} - exclude: ${{ fromJSON(inputs.exclude) || [] }} + include: ${{ fromJSON(inputs.include) || fromJSON('[]') }} + exclude: ${{ fromJSON(inputs.exclude) || fromJSON('[]') }} defaults: run: From 3502c88ddd6745c1055ed8f75c2ac3f43be467a5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 16:25:51 +0200 Subject: [PATCH 05/70] Fix input default value on non-call --- .github/workflows/base_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 61eda085b3..6eea11ecc2 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -55,8 +55,8 @@ jobs: nim-branch: - version-1-6 - version-2-0 - include: ${{ fromJSON(inputs.include) || fromJSON('[]') }} - exclude: ${{ fromJSON(inputs.exclude) || fromJSON('[]') }} + include: ${{ inputs.include != 0 && fromJSON(inputs.include) || fromJSON('[]') }} + exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} defaults: run: From c146f751779878102af1a134f3f5d2a53a9e8b31 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 16:27:59 +0200 Subject: [PATCH 06/70] Fix tests job naming --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 6eea11ecc2..db1719b28f 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -62,7 +62,7 @@ jobs: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim-branch }})' runs-on: ${{ matrix.platform.builder }} continue-on-error: ${{ matrix.nim-branch == 'version-2-0' }} steps: From 2d21d543626afa1b8e83e49be8a019c28dddc221 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 19:28:46 +0200 Subject: [PATCH 07/70] Add some comments, split coverage by steps --- .github/workflows/base_tests.yml | 3 +++ .github/workflows/coverage.yml | 22 ++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index db1719b28f..7ede3d787b 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -55,6 +55,9 @@ jobs: nim-branch: - version-1-6 - version-2-0 + # If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs). + # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). + # This relies on the value 0 meaning the parameter was not filled in. include: ${{ inputs.include != 0 && fromJSON(inputs.include) || fromJSON('[]') }} exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fdd523cdfe..ca0fd20e22 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,25 +44,35 @@ jobs: if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} run: | nimble install_pinned - - - name: Run + + - name: Install coverage tools and setup run: | sudo apt-get update sudo apt-get install -y lcov build-essential git curl mkdir coverage + + - name: Run coverage-enabled test suite + run: | export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" nimble testnative nimble testpubsub nimble testfilter + + - name: Run coverage + run: | find nimcache -name *.c -delete lcov --capture --directory nimcache --output-file coverage/coverage.info shopt -s globstar ls `pwd`/libp2p/{*,**/*}.nim lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info genhtml coverage/coverage.f.info --output-directory coverage/output + + - name: Upload coverage to codecov + run: | bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" - #- uses: actions/upload-artifact@master - # with: - # name: coverage - # path: coverage + # Alternatively, use the upload artifact action + # - uses: actions/upload-artifact@master + # with: + # name: coverage + # path: coverage From cb704943d7f5c30197849169427316abd957ee24 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 6 Jun 2024 21:10:09 +0200 Subject: [PATCH 08/70] Remove nim2 from base testing --- .github/workflows/base_tests.yml | 3 +-- .github/workflows/daily.yml | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 7ede3d787b..008779e8a8 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -54,7 +54,6 @@ jobs: shell: msys2 {0} nim-branch: - version-1-6 - - version-2-0 # If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs). # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). # This relies on the value 0 meaning the parameter was not filled in. @@ -67,7 +66,7 @@ jobs: name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim-branch }})' runs-on: ${{ matrix.platform.builder }} - continue-on-error: ${{ matrix.nim-branch == 'version-2-0' }} + continue-on-error: ${{ matrix.nim-branch == 'version-2-0' || matrix.nim-branch == 'devel' }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 446a0bdd1f..2acbef2f50 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,17 +9,18 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_tests.yml with: - exclude: "[{'platform': {'cpu': 'amd64'}}]" + include: "[{'nim-branch': 'version-2-0'}]" + exclude: "[{'platform': {'cpu': 'i386'}}]" test_i386: name: Daily i386 uses: ./.github/workflows/base_tests.yml with: - exclude: "[{'platform': {'cpu': 'i386'}}]" + exclude: "[{'platform': {'cpu': 'amd64'}}]" test_nim_devel: name: Daily uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim-branch': ['devel']}]" - exclude: "[{'platform': {'os': 'linux', 'cpu': 'amd64'}}]" + include: "[{'nim-branch': 'devel'}]" + exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" From 2e103b0c8b6dc0d9572e4c578588e3f463a440f3 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 7 Jun 2024 15:08:02 +0200 Subject: [PATCH 09/70] Update actions versions --- .github/workflows/base_tests.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/documentation.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 008779e8a8..43480d7aaa 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -82,7 +82,7 @@ jobs: cpu: ${{ matrix.platform.cpu }} - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '~1.15.5' cache: false diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ca0fd20e22..faeaf70150 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -35,7 +35,7 @@ jobs: - name: Restore deps from cache id: deps-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: nimbledeps key: nimbledeps-${{ hashFiles('.pinned') }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 489e137e00..530045a8a8 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -14,7 +14,7 @@ jobs: continue-on-error: true steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true @@ -34,7 +34,7 @@ jobs: ls ${GITHUB_REF##*/} - name: Clone the gh-pages branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: vacp2p/nim-libp2p ref: gh-pages @@ -65,7 +65,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions/setup-python@v2 with: @@ -79,7 +79,7 @@ jobs: run: pip install mkdocs-material && nimble -y website - name: Clone the gh-pages branch - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: vacp2p/nim-libp2p ref: gh-pages From e7fb13b1e56dbf6fefc923dee74f8823fb19db84 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 10 Jun 2024 12:18:55 +0200 Subject: [PATCH 10/70] Add memory management flag to test matrix, naming. --- .github/actions/install_nim/action.yml | 4 ++-- .github/workflows/base_tests.yml | 18 +++++++++++------- .github/workflows/coverage.yml | 2 +- .github/workflows/daily.yml | 4 ++-- .github/workflows/dependencies.yml | 2 +- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/actions/install_nim/action.yml b/.github/actions/install_nim/action.yml index 1bb49fcb8d..83de4f313a 100644 --- a/.github/actions/install_nim/action.yml +++ b/.github/actions/install_nim/action.yml @@ -61,7 +61,7 @@ runs: - name: Restore Nim DLLs dependencies (Windows) from cache if: inputs.os == 'Windows' id: windows-dlls-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: external/dlls key: 'dlls' @@ -114,7 +114,7 @@ runs: - name: Restore Nim from cache id: nim-cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: '${{ github.workspace }}/nim' key: ${{ inputs.os }}-${{ inputs.cpu }}-nim-${{ inputs.nim_branch }}-cache-${{ env.cache_nonce }} diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 43480d7aaa..9af67482e9 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -52,8 +52,13 @@ jobs: builder: windows-2022 cpu: amd64 shell: msys2 {0} - nim-branch: - - version-1-6 + nim_branch: + - version: version-1-6 + memory_management: refc + # - version: version-2-0 + # memory_management: orc + # - version: devel + # memory_management: orc # If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs). # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). # This relies on the value 0 meaning the parameter was not filled in. @@ -64,9 +69,9 @@ jobs: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim-branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch }})' runs-on: ${{ matrix.platform.builder }} - continue-on-error: ${{ matrix.nim-branch == 'version-2-0' || matrix.nim-branch == 'devel' }} + continue-on-error: ${{ matrix.nim_branch == 'version-2-0' || matrix.nim_branch == 'devel' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -78,7 +83,7 @@ jobs: with: os: ${{ matrix.platform.os }} shell: ${{ matrix.platform.shell }} - nim_branch: ${{ matrix.nim-branch }} + nim_branch: ${{ matrix.nim_branch }} cpu: ${{ matrix.platform.cpu }} - name: Setup Go @@ -99,8 +104,7 @@ jobs: run: | nim --version nimble --version - # --mm:orc | Should we run tests with ORC instead? - NIMFLAGS="${NIMFLAGS} --mm:refc" + NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" nimble test lint: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index faeaf70150..be0ae56225 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,7 +22,7 @@ jobs: env: CICOV: YES steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 2acbef2f50..01c3b8b21e 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,7 +9,7 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim-branch': 'version-2-0'}]" + include: "[{'nim_branch': 'version-2-0', 'memory_management': 'orc'}]" exclude: "[{'platform': {'cpu': 'i386'}}]" test_i386: @@ -22,5 +22,5 @@ jobs: name: Daily uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim-branch': 'devel'}]" + include: "[{'nim_branch': 'devel'}, 'memory_management': 'orc']" exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index f7ed27ca10..002c4b3022 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -20,7 +20,7 @@ jobs: ] steps: - name: Clone repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: ${{ matrix.target.repo }} ref: ${{ matrix.target.branch }} From 0372da3d32d65abc544e0599146f6594caaeda4f Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 10 Jun 2024 12:40:28 +0200 Subject: [PATCH 11/70] Fix nim_branch object keys. --- .github/workflows/base_tests.yml | 6 +++--- .github/workflows/daily.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 9af67482e9..75619797b7 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -69,9 +69,9 @@ jobs: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' runs-on: ${{ matrix.platform.builder }} - continue-on-error: ${{ matrix.nim_branch == 'version-2-0' || matrix.nim_branch == 'devel' }} + continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -83,7 +83,7 @@ jobs: with: os: ${{ matrix.platform.os }} shell: ${{ matrix.platform.shell }} - nim_branch: ${{ matrix.nim_branch }} + nim_branch: ${{ matrix.nim_branch.version }} cpu: ${{ matrix.platform.cpu }} - name: Setup Go diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 01c3b8b21e..d166132cef 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,7 +9,7 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim_branch': 'version-2-0', 'memory_management': 'orc'}]" + include: "[{'nim_branch': {'version': 'version-2-0', 'memory_management': 'orc'}}]" exclude: "[{'platform': {'cpu': 'i386'}}]" test_i386: @@ -22,5 +22,5 @@ jobs: name: Daily uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim_branch': 'devel'}, 'memory_management': 'orc']" + include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" From 9e9ea68a2f284123c1c303855ca7e03527fe4ff3 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 10 Jul 2024 21:14:57 +0200 Subject: [PATCH 12/70] Remove ci.yml again, add nim version 2.0 for base_tests.yml --- .github/workflows/base_tests.yml | 4 ++-- .github/workflows/daily.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 75619797b7..2119d91b21 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -55,8 +55,8 @@ jobs: nim_branch: - version: version-1-6 memory_management: refc - # - version: version-2-0 - # memory_management: orc + - version: version-2-0 + memory_management: refc # - version: devel # memory_management: orc # If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs). diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index d166132cef..483fb8da0e 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,14 +9,13 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim_branch': {'version': 'version-2-0', 'memory_management': 'orc'}}]" exclude: "[{'platform': {'cpu': 'i386'}}]" test_i386: name: Daily i386 uses: ./.github/workflows/base_tests.yml with: - exclude: "[{'platform': {'cpu': 'amd64'}}]" + exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" test_nim_devel: name: Daily From 9401ab796ed319b369364f7e4725bfac833813b6 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 10 Jul 2024 21:39:42 +0200 Subject: [PATCH 13/70] Move code formatter to different workflow --- .github/workflows/base_tests.yml | 40 ++++++++++++++++---------------- .github/workflows/formatter.yml | 34 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/formatter.yml diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 2119d91b21..b9410ddd60 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -107,24 +107,24 @@ jobs: NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" nimble test - lint: - name: "Lint" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base + # lint: + # name: "Lint" + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base - - name: Check nph formatting - # Pin nph to a specific version to avoid sudden style differences. - # Updating nph version should be accompanied with running the new - # version on the fluffy directory. - run: | - VERSION="v0.5.1" - ARCHIVE="nph-linux_x64.tar.gz" - curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} - tar -xzf ${ARCHIVE} - shopt -s extglob # Enable extended globbing - ./nph examples libp2p tests tools *.@(nim|nims|nimble) - git diff --exit-code + # - name: Check nph formatting + # # Pin nph to a specific version to avoid sudden style differences. + # # Updating nph version should be accompanied with running the new + # # version on the fluffy directory. + # run: | + # VERSION="v0.5.1" + # ARCHIVE="nph-linux_x64.tar.gz" + # curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} + # tar -xzf ${ARCHIVE} + # shopt -s extglob # Enable extended globbing + # ./nph examples libp2p tests tools *.@(nim|nims|nimble) + # git diff --exit-code diff --git a/.github/workflows/formatter.yml b/.github/workflows/formatter.yml new file mode 100644 index 0000000000..c2ff4f9613 --- /dev/null +++ b/.github/workflows/formatter.yml @@ -0,0 +1,34 @@ +name: Code Formatter + +on: + push: + branches: + - master + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + formatter: + name: "Format Codebase" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base + + - name: Format with NPH + # Pin nph to a specific version to avoid sudden style differences. + # Updating nph version should be accompanied with running the new + # version on the fluffy directory. + run: | + VERSION="v0.5.1" + ARCHIVE="nph-linux_x64.tar.gz" + curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} + tar -xzf ${ARCHIVE} + shopt -s extglob # Enable extended globbing + ./nph examples libp2p tests tools *.@(nim|nims|nimble) + git diff --exit-code From 0d692e7816d33d6c633c59b433061df28eba63b5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:06:09 +0200 Subject: [PATCH 14/70] Update dependencies workflow comments. --- .github/workflows/dependencies.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 002c4b3022..50639b18c5 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -7,23 +7,23 @@ on: jobs: update_version: - # Is this job necessary? + # Pushes new refs to interested external repositories, so they can do early testing against them. runs-on: ubuntu-latest - name: Updating version on ${{ matrix.target.repo }}:${{ matrix.target.branch }} + name: Update libp2p's version for ${{ matrix.target.repo }} from ${{ matrix.target.source_ref }} strategy: fail-fast: false matrix: target: [ - { repo: status-im/nimbus-eth2, branch: unstable }, - { repo: waku-org/nwaku, branch: master }, - { repo: codex-storage/nim-codex, branch: master } + { repo: status-im/nimbus-eth2, source_ref: master }, + { repo: waku-org/nwaku, source_ref: master }, + { repo: codex-storage/nim-codex, source_ref: master } ] steps: - name: Clone repo uses: actions/checkout@v4 with: repository: ${{ matrix.target.repo }} - ref: ${{ matrix.target.branch }} + ref: ${{ matrix.target.source_ref}} path: nbc fetch-depth: 0 token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} @@ -35,8 +35,7 @@ jobs: cd vendor/nim-libp2p git checkout $GITHUB_SHA - - name: Commit this bump - # Is it mandatory to create a new commit? Or does it exist as a way to communicate why the version was updated. + - name: Commit this ref run: | cd nbc git config --global user.email "${{ github.actor }}@users.noreply.github.com" @@ -45,3 +44,4 @@ jobs: git branch -D nim-libp2p-auto-bump-${GITHUB_REF##*/} || true git switch -c nim-libp2p-auto-bump-${GITHUB_REF##*/} git push -f origin nim-libp2p-auto-bump-${GITHUB_REF##*/} + From 1f402c32bc0c51ffb5eae951984b261a893e56ca Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:09:26 +0200 Subject: [PATCH 15/70] Add comment for clarity. --- .github/workflows/base_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index b9410ddd60..36bcb16780 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -57,9 +57,11 @@ jobs: memory_management: refc - version: version-2-0 memory_management: refc + # This last combination is injected via "include" in the "test_nim_devel" daily test. Also written here for clarity. # - version: devel # memory_management: orc - # If exclude or include are defined use their value, otherwise default to empty list (as declared on workflow_call.inputs). + + # If exclude or include are defined then use their value, otherwise default to empty list (as declared on workflow_call.inputs). # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). # This relies on the value 0 meaning the parameter was not filled in. include: ${{ inputs.include != 0 && fromJSON(inputs.include) || fromJSON('[]') }} From e6a1b658a154e0d7635e145d25cade69f5b04bc9 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:12:58 +0200 Subject: [PATCH 16/70] Rename formatter to linter, and correct names. --- .github/workflows/{formatter.yml => linter.yml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{formatter.yml => linter.yml} (91%) diff --git a/.github/workflows/formatter.yml b/.github/workflows/linter.yml similarity index 91% rename from .github/workflows/formatter.yml rename to .github/workflows/linter.yml index c2ff4f9613..ed6af421b7 100644 --- a/.github/workflows/formatter.yml +++ b/.github/workflows/linter.yml @@ -1,4 +1,4 @@ -name: Code Formatter +name: Linter on: push: @@ -11,8 +11,8 @@ concurrency: cancel-in-progress: true jobs: - formatter: - name: "Format Codebase" + nph: + name: "NPH Linter" runs-on: ubuntu-latest steps: - name: Checkout @@ -20,7 +20,7 @@ jobs: with: fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base - - name: Format with NPH + - name: Lint style # Pin nph to a specific version to avoid sudden style differences. # Updating nph version should be accompanied with running the new # version on the fluffy directory. From e016767f67700927d897ba876d02a43b0b9f38c2 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:13:23 +0200 Subject: [PATCH 17/70] Only run linter on PR. --- .github/workflows/linter.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ed6af421b7..28595d4779 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,9 +1,6 @@ name: Linter on: - push: - branches: - - master pull_request: concurrency: From 577f6ec2c60f00391b7ddee7e8b0ca00a74b8104 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:16:45 +0200 Subject: [PATCH 18/70] Remove commented out code. --- .github/workflows/base_tests.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 36bcb16780..3156676570 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -109,24 +109,3 @@ jobs: NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" nimble test - # lint: - # name: "Lint" - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base - - # - name: Check nph formatting - # # Pin nph to a specific version to avoid sudden style differences. - # # Updating nph version should be accompanied with running the new - # # version on the fluffy directory. - # run: | - # VERSION="v0.5.1" - # ARCHIVE="nph-linux_x64.tar.gz" - # curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} - # tar -xzf ${ARCHIVE} - # shopt -s extglob # Enable extended globbing - # ./nph examples libp2p tests tools *.@(nim|nims|nimble) - # git diff --exit-code From b772766294b8dea05fb6718155b975943a930da1 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:33:19 +0200 Subject: [PATCH 19/70] Enable codecov on all PRs. --- .github/workflows/coverage.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index be0ae56225..d48d4871fc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -6,8 +6,6 @@ on: branches: - master pull_request: - branches: - - master workflow_dispatch: concurrency: From d0ef28f920432941032090778da4742e84bfdb20 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:40:23 +0200 Subject: [PATCH 20/70] Remove CI yet again. --- .github/workflows/ci.yml | 113 --------------------------------------- 1 file changed, 113 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 42c130df76..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,113 +0,0 @@ -name: CI -on: - push: - branches: - - master - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test-all: - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - target: - - os: linux - cpu: amd64 - - os: linux - cpu: i386 - - os: macos - cpu: amd64 - - os: windows - cpu: amd64 - #- os: windows - #cpu: i386 - branch: [version-1-6, version-2-0] - include: - - target: - os: linux - builder: ubuntu-22.04 - shell: bash - - target: - os: macos - builder: macos-13 - shell: bash - - target: - os: windows - builder: windows-2022 - shell: msys2 {0} - - defaults: - run: - shell: ${{ matrix.shell }} - - name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.branch }})' - runs-on: ${{ matrix.builder }} - continue-on-error: ${{ matrix.branch == 'devel' }} - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - - - name: Setup Nim - uses: "./.github/actions/install_nim" - with: - os: ${{ matrix.target.os }} - cpu: ${{ matrix.target.cpu }} - shell: ${{ matrix.shell }} - nim_branch: ${{ matrix.branch }} - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '~1.15.5' - - - name: Install p2pd - run: | - V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 - - - name: Restore deps from cache - id: deps-cache - uses: actions/cache@v3 - with: - path: nimbledeps - key: nimbledeps-${{ hashFiles('.pinned') }} - - - name: Install deps - if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} - run: | - nimble install_pinned - - - name: Run tests - run: | - nim --version - nimble --version - nimble test - - lint: - name: "Lint" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base - - - name: Check nph formatting - # Pin nph to a specific version to avoid sudden style differences. - # Updating nph version should be accompanied with running the new - # version on the fluffy directory. - run: | - VERSION="v0.5.1" - ARCHIVE="nph-linux_x64.tar.gz" - curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} - tar -xzf ${ARCHIVE} - shopt -s extglob # Enable extended globbing - ./nph examples libp2p tests tools *.@(nim|nims|nimble) - git diff --exit-code From 761dd4ec70e9d052ca2981c3dfb7eb5e24431474 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 16:49:36 +0200 Subject: [PATCH 21/70] Undo dependencies target ref misshap. --- .github/workflows/dependencies.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 50639b18c5..fc836866e7 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -7,23 +7,23 @@ on: jobs: update_version: - # Pushes new refs to interested external repositories, so they can do early testing against them. + # Pushes new refs to interested external repositorysitories, so they can do early testing against them. runs-on: ubuntu-latest - name: Update libp2p's version for ${{ matrix.target.repo }} from ${{ matrix.target.source_ref }} + name: Update libp2p's version for ${{ matrix.target.repository }} from ${{ matrix.target.ref }} strategy: fail-fast: false matrix: target: [ - { repo: status-im/nimbus-eth2, source_ref: master }, - { repo: waku-org/nwaku, source_ref: master }, - { repo: codex-storage/nim-codex, source_ref: master } + { repository: status-im/nimbus-eth2, ref: unstable }, + { repository: waku-org/nwaku, ref: master }, + { repository: codex-storage/nim-codex, ref: master } ] steps: - - name: Clone repo + - name: Clone repository uses: actions/checkout@v4 with: - repository: ${{ matrix.target.repo }} - ref: ${{ matrix.target.source_ref}} + repositorysitory: ${{ matrix.target.repository }} + ref: ${{ matrix.target.ref}} path: nbc fetch-depth: 0 token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} From bec16116e81b9e31a91b80a15b54daaae2351e7a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 17:17:17 +0200 Subject: [PATCH 22/70] Remove unused step from codecov. --- .github/workflows/coverage.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d48d4871fc..e101c16c3e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -69,8 +69,3 @@ jobs: run: | bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" - # Alternatively, use the upload artifact action - # - uses: actions/upload-artifact@master - # with: - # name: coverage - # path: coverage From c4bfddf23aa85e7ea34152ecf8ad47c912a4c875 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Wed, 17 Jul 2024 19:35:04 +0200 Subject: [PATCH 23/70] Improve naming on dependencies workflow. --- .github/workflows/dependencies.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index fc836866e7..5008e210a2 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -1,4 +1,4 @@ -name: Update this project's version where it servers as a dependency +name: Update libp2p's version where it serves as a dependency on: push: branches: @@ -7,9 +7,9 @@ on: jobs: update_version: - # Pushes new refs to interested external repositorysitories, so they can do early testing against them. + # Pushes new refs to interested external repositories, so they can do early testing against them. runs-on: ubuntu-latest - name: Update libp2p's version for ${{ matrix.target.repository }} from ${{ matrix.target.ref }} + name: Update libp2p's version for ${{ matrix.target.repository }}:${{ matrix.target.ref }} strategy: fail-fast: false matrix: @@ -19,23 +19,23 @@ jobs: { repository: codex-storage/nim-codex, ref: master } ] steps: - - name: Clone repository + - name: Clone target repository uses: actions/checkout@v4 with: - repositorysitory: ${{ matrix.target.repository }} + repository: ${{ matrix.target.repository }} ref: ${{ matrix.target.ref}} path: nbc fetch-depth: 0 token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} - - name: Checkout this ref + - name: Checkout this ref in target repository run: | cd nbc git submodule update --init vendor/nim-libp2p cd vendor/nim-libp2p git checkout $GITHUB_SHA - - name: Commit this ref + - name: Push this ref to target repository run: | cd nbc git config --global user.email "${{ github.actor }}@users.noreply.github.com" From aa361b44d96b89d8f6ec481d8f54cd0de38f599b Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 17:33:17 +0200 Subject: [PATCH 24/70] Temporarily enable daily runs on pull request event. --- .github/workflows/daily.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 483fb8da0e..dee83002e2 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -3,6 +3,7 @@ on: schedule: - cron: "30 6 * * *" workflow_dispatch: + pull_request: jobs: test_amd64: From b322115a83c066be357d63d520ad5b42a7f60479 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:01:32 +0200 Subject: [PATCH 25/70] Add concurrency groups for daily jobs --- .github/workflows/daily.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index dee83002e2..6bc2d91cc4 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -9,18 +9,24 @@ jobs: test_amd64: name: Daily amd64 uses: ./.github/workflows/base_tests.yml + concurrency: + group: amd64 with: exclude: "[{'platform': {'cpu': 'i386'}}]" test_i386: name: Daily i386 uses: ./.github/workflows/base_tests.yml + concurrency: + group: i386 with: exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" test_nim_devel: name: Daily uses: ./.github/workflows/base_tests.yml + concurrency: + group: devel with: include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" From d526d5132b526843ce78265326c905bdf2a19dff Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:04:30 +0200 Subject: [PATCH 26/70] wip --- .github/workflows/base_tests.yml | 12 ++++++------ .github/workflows/daily.yml | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 3156676570..8f588791e6 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -102,10 +102,10 @@ jobs: run: | nimble install -y --depsOnly - - name: Run tests - run: | - nim --version - nimble --version - NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" - nimble test + # - name: Run tests + # run: | + # nim --version + # nimble --version + # NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" + # nimble test diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 6bc2d91cc4..10e409d8d7 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,6 +5,9 @@ on: workflow_dispatch: pull_request: +concurrency: + group: daily + jobs: test_amd64: name: Daily amd64 @@ -23,7 +26,7 @@ jobs: exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" test_nim_devel: - name: Daily + name: Daily devel uses: ./.github/workflows/base_tests.yml concurrency: group: devel From 1cc7d86e510f4d62b4df73403afc78c9052a7987 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:11:17 +0200 Subject: [PATCH 27/70] wip --- .github/workflows/base_tests.yml | 6 +++--- .github/workflows/daily.yml | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 8f588791e6..c631f7a797 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -18,9 +18,9 @@ on: type: string default: "[]" -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true +# concurrency: +# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} +# cancel-in-progress: true jobs: delete_cache: diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 10e409d8d7..2ee5b76360 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,9 +5,6 @@ on: workflow_dispatch: pull_request: -concurrency: - group: daily - jobs: test_amd64: name: Daily amd64 From ecb6e207935b0f4b93c3dda908493d70868990e5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:19:48 +0200 Subject: [PATCH 28/70] wip --- .github/workflows/base_tests.yml | 6 +++--- .github/workflows/daily.yml | 4 ++++ .github/workflows/linter.yml | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index c631f7a797..8f588791e6 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -18,9 +18,9 @@ on: type: string default: "[]" -# concurrency: -# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true jobs: delete_cache: diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 2ee5b76360..ac856d97fc 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -5,6 +5,10 @@ on: workflow_dispatch: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.job }} + cancel-in-progress: true + jobs: test_amd64: name: Daily amd64 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 28595d4779..e56106eb8b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,4 +1,4 @@ -name: Linter +name: Linters on: pull_request: @@ -9,7 +9,7 @@ concurrency: jobs: nph: - name: "NPH Linter" + name: NPH runs-on: ubuntu-latest steps: - name: Checkout From e3e2be5b78fad10c7c25491009040adc21042a46 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:27:51 +0200 Subject: [PATCH 29/70] wip --- .github/workflows/dailies/amd64.yml | 13 +++++++++++ .github/workflows/dailies/devel.yml | 14 +++++++++++ .github/workflows/dailies/i386.yml | 13 +++++++++++ .github/workflows/daily.yml | 36 ----------------------------- 4 files changed, 40 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/dailies/amd64.yml create mode 100644 .github/workflows/dailies/devel.yml create mode 100644 .github/workflows/dailies/i386.yml delete mode 100644 .github/workflows/daily.yml diff --git a/.github/workflows/dailies/amd64.yml b/.github/workflows/dailies/amd64.yml new file mode 100644 index 0000000000..eaaddf5e75 --- /dev/null +++ b/.github/workflows/dailies/amd64.yml @@ -0,0 +1,13 @@ +name: Daily Tests +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: + +jobs: + test_amd64: + name: Daily amd64 + uses: ./.github/workflows/base_tests.yml + with: + exclude: "[{'platform': {'cpu': 'i386'}}]" diff --git a/.github/workflows/dailies/devel.yml b/.github/workflows/dailies/devel.yml new file mode 100644 index 0000000000..cb0e011346 --- /dev/null +++ b/.github/workflows/dailies/devel.yml @@ -0,0 +1,14 @@ +name: Daily Tests +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: + +jobs: + test_nim_devel: + name: Daily devel + uses: ./.github/workflows/base_tests.yml + with: + include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" + exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" diff --git a/.github/workflows/dailies/i386.yml b/.github/workflows/dailies/i386.yml new file mode 100644 index 0000000000..91f26acc26 --- /dev/null +++ b/.github/workflows/dailies/i386.yml @@ -0,0 +1,13 @@ +name: Daily Tests +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: + +jobs: + test_i386: + name: Daily i386 + uses: ./.github/workflows/base_tests.yml + with: + exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml deleted file mode 100644 index ac856d97fc..0000000000 --- a/.github/workflows/daily.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Daily Tests -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.job }} - cancel-in-progress: true - -jobs: - test_amd64: - name: Daily amd64 - uses: ./.github/workflows/base_tests.yml - concurrency: - group: amd64 - with: - exclude: "[{'platform': {'cpu': 'i386'}}]" - - test_i386: - name: Daily i386 - uses: ./.github/workflows/base_tests.yml - concurrency: - group: i386 - with: - exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" - - test_nim_devel: - name: Daily devel - uses: ./.github/workflows/base_tests.yml - concurrency: - group: devel - with: - include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" - exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" From e5fccf11226a1c07aea98620c399f2871e738a6a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:29:05 +0200 Subject: [PATCH 30/70] wip --- .github/workflows/{dailies/amd64.yml => daily_amd64.yml} | 0 .github/workflows/{dailies/devel.yml => daily_devel.yml} | 0 .github/workflows/{dailies/i386.yml => daily_i386.yml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dailies/amd64.yml => daily_amd64.yml} (100%) rename .github/workflows/{dailies/devel.yml => daily_devel.yml} (100%) rename .github/workflows/{dailies/i386.yml => daily_i386.yml} (100%) diff --git a/.github/workflows/dailies/amd64.yml b/.github/workflows/daily_amd64.yml similarity index 100% rename from .github/workflows/dailies/amd64.yml rename to .github/workflows/daily_amd64.yml diff --git a/.github/workflows/dailies/devel.yml b/.github/workflows/daily_devel.yml similarity index 100% rename from .github/workflows/dailies/devel.yml rename to .github/workflows/daily_devel.yml diff --git a/.github/workflows/dailies/i386.yml b/.github/workflows/daily_i386.yml similarity index 100% rename from .github/workflows/dailies/i386.yml rename to .github/workflows/daily_i386.yml From 474d2823c188564be31cc4739478e2231cbf1f03 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:30:25 +0200 Subject: [PATCH 31/70] wip --- .github/workflows/daily_amd64.yml | 2 +- .github/workflows/daily_devel.yml | 4 ++-- .github/workflows/daily_i386.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index eaaddf5e75..c71395e37f 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -1,4 +1,4 @@ -name: Daily Tests +name: Daily amd64 on: schedule: - cron: "30 6 * * *" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index cb0e011346..4b3cfdc6d1 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -1,4 +1,4 @@ -name: Daily Tests +name: Daily Nim Devel on: schedule: - cron: "30 6 * * *" @@ -7,7 +7,7 @@ on: jobs: test_nim_devel: - name: Daily devel + name: Daily Nim Devel uses: ./.github/workflows/base_tests.yml with: include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 91f26acc26..998f5bb769 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -1,4 +1,4 @@ -name: Daily Tests +name: Daily i386 on: schedule: - cron: "30 6 * * *" From 43133fa017b143f3759c7b455a6993afa02ec272 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:45:25 +0200 Subject: [PATCH 32/70] wip --- .github/workflows/base_tests.yml | 56 ++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 8f588791e6..027c9da860 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -72,35 +72,51 @@ jobs: shell: ${{ matrix.platform.shell }} name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' - runs-on: ${{ matrix.platform.builder }} + runs-on: ubuntu-22.04 continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Setup Nim - uses: "./.github/actions/install_nim" + - name: Matrix info with: os: ${{ matrix.platform.os }} + builder: ${{ matrix.platform.builder }} + cpu: ${{ matrix.platform.cpu }} shell: ${{ matrix.platform.shell }} nim_branch: ${{ matrix.nim_branch.version }} - cpu: ${{ matrix.platform.cpu }} + memory_management: ${{ matrix.nim_branch.memory_management }} + run: | + echo $os + echo $builder + echo $cpu + echo $shell + echo $nim_branch + echo $memory_management - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '~1.15.5' - cache: false + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # submodules: true - - name: Install p2pd - run: | - V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 + # - name: Setup Nim + # uses: "./.github/actions/install_nim" + # with: + # os: ${{ matrix.platform.os }} + # shell: ${{ matrix.platform.shell }} + # nim_branch: ${{ matrix.nim_branch.version }} + # cpu: ${{ matrix.platform.cpu }} + + # - name: Setup Go + # uses: actions/setup-go@v5 + # with: + # go-version: '~1.15.5' + # cache: false + + # - name: Install p2pd + # run: | + # V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 - - name: Install deps - run: | - nimble install -y --depsOnly + # - name: Install deps + # run: | + # nimble install -y --depsOnly # - name: Run tests # run: | From 02939c578ea8523ce90fcb73c8eb690b0b0d17e9 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 19:48:31 +0200 Subject: [PATCH 33/70] wip --- .github/workflows/base_tests.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 027c9da860..45076d579f 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -76,20 +76,13 @@ jobs: continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: - name: Matrix info - with: - os: ${{ matrix.platform.os }} - builder: ${{ matrix.platform.builder }} - cpu: ${{ matrix.platform.cpu }} - shell: ${{ matrix.platform.shell }} - nim_branch: ${{ matrix.nim_branch.version }} - memory_management: ${{ matrix.nim_branch.memory_management }} run: | - echo $os - echo $builder - echo $cpu - echo $shell - echo $nim_branch - echo $memory_management + echo ${{ matrix.platform.os }} + echo ${{ matrix.platform.builder }} + echo ${{ matrix.platform.cpu }} + echo ${{ matrix.platform.shell }} + echo ${{ matrix.nim_branch.version }} + echo ${{ matrix.nim_branch.memory_management }} # - name: Checkout # uses: actions/checkout@v4 From 629e762eba090a2f031a8818b92339ca6188f8de Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Thu, 18 Jul 2024 21:26:14 +0200 Subject: [PATCH 34/70] wip --- .github/workflows/base_tests.yml | 60 +++++++++---------- .github/workflows/coverage.yml | 98 ++++++++++++++++---------------- .github/workflows/interop.yml | 54 +++++++++--------- 3 files changed, 107 insertions(+), 105 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 45076d579f..5a1865426d 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -7,9 +7,9 @@ on: pull_request: workflow_call: inputs: - include: - description: 'Include matrix configurations' - required: false + nim_branch: + description: 'Nim branch configurations' + required: true type: string default: "[]" exclude: @@ -37,52 +37,54 @@ jobs: matrix: platform: - os: linux - builder: ubuntu-22.04 cpu: amd64 - shell: bash - os: linux - builder: ubuntu-22.04 cpu: i386 - shell: bash - os: macos - builder: macos-13 cpu: amd64 - shell: bash - os: windows - builder: windows-2022 cpu: amd64 - shell: msys2 {0} - nim_branch: - - version: version-1-6 - memory_management: refc - - version: version-2-0 - memory_management: refc - # This last combination is injected via "include" in the "test_nim_devel" daily test. Also written here for clarity. - # - version: devel - # memory_management: orc + nim_branch: ${{ inputs.exclude != 0 && fromJSON(inputs.nim_branch) || fromJSON("[{'version': 'version-1-6'}, {'version': 'version-2-0'}]") }} + include: + - platform: + os: linux + builder: ubuntu-22.04 + shell: bash + - platform: + os: macos + builder: macos-13 + shell: bash + - platform: + os: windows + builder: windows-2022 + shell: msys2 {0}ve + - nim_branch: + version: version-1-6 + memory_management: refc + - nim_branch: + version: version-2-0 + memory_management: refc + - nim_branch: + version: devel + memory_management: orc - # If exclude or include are defined then use their value, otherwise default to empty list (as declared on workflow_call.inputs). + # If exclude is defined then use its value, otherwise default to empty list (as declared on workflow_call.inputs). # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). # This relies on the value 0 meaning the parameter was not filled in. - include: ${{ inputs.include != 0 && fromJSON(inputs.include) || fromJSON('[]') }} + # exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} defaults: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' + # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.platform.builder }}-${{ matrix.platform.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' runs-on: ubuntu-22.04 continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: - name: Matrix info - run: | - echo ${{ matrix.platform.os }} - echo ${{ matrix.platform.builder }} - echo ${{ matrix.platform.cpu }} - echo ${{ matrix.platform.shell }} - echo ${{ matrix.nim_branch.version }} - echo ${{ matrix.nim_branch.memory_management }} + run: "" # - name: Checkout # uses: actions/checkout@v4 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e101c16c3e..52489ccd69 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,60 +12,60 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -jobs: - codecov: - # Improvement: Split single job into run tests, generate coverage, and upload to codecov. - name: Run coverage and upload to codecov - runs-on: ubuntu-22.04 - env: - CICOV: YES - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 +# jobs: +# codecov: +# # Improvement: Split single job into run tests, generate coverage, and upload to codecov. +# name: Run coverage and upload to codecov +# runs-on: ubuntu-22.04 +# env: +# CICOV: YES +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 - - name: Setup Nim - uses: "./.github/actions/install_nim" - with: - os: linux - cpu: amd64 - shell: bash +# - name: Setup Nim +# uses: "./.github/actions/install_nim" +# with: +# os: linux +# cpu: amd64 +# shell: bash - - name: Restore deps from cache - id: deps-cache - uses: actions/cache@v4 - with: - path: nimbledeps - key: nimbledeps-${{ hashFiles('.pinned') }} +# - name: Restore deps from cache +# id: deps-cache +# uses: actions/cache@v4 +# with: +# path: nimbledeps +# key: nimbledeps-${{ hashFiles('.pinned') }} - - name: Install deps - if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} - run: | - nimble install_pinned +# - name: Install deps +# if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} +# run: | +# nimble install_pinned - - name: Install coverage tools and setup - run: | - sudo apt-get update - sudo apt-get install -y lcov build-essential git curl - mkdir coverage +# - name: Install coverage tools and setup +# run: | +# sudo apt-get update +# sudo apt-get install -y lcov build-essential git curl +# mkdir coverage - - name: Run coverage-enabled test suite - run: | - export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" - nimble testnative - nimble testpubsub - nimble testfilter +# - name: Run coverage-enabled test suite +# run: | +# export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" +# nimble testnative +# nimble testpubsub +# nimble testfilter - - name: Run coverage - run: | - find nimcache -name *.c -delete - lcov --capture --directory nimcache --output-file coverage/coverage.info - shopt -s globstar - ls `pwd`/libp2p/{*,**/*}.nim - lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info - genhtml coverage/coverage.f.info --output-directory coverage/output +# - name: Run coverage +# run: | +# find nimcache -name *.c -delete +# lcov --capture --directory nimcache --output-file coverage/coverage.info +# shopt -s globstar +# ls `pwd`/libp2p/{*,**/*}.nim +# lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info +# genhtml coverage/coverage.f.info --output-directory coverage/output - - name: Upload coverage to codecov - run: | - bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" +# - name: Upload coverage to codecov +# run: | +# bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index c9a6853626..830e6d8eb5 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -10,31 +10,31 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -jobs: - run-transport-interop: - name: Run transport interoperability tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: Build image - run: docker buildx build --load -t nim-libp2p-head -f tests/transport-interop/Dockerfile . - - name: Run tests - uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master - with: - test-filter: nim-libp2p-head - extra-versions: ${{ github.workspace }}/tests/transport-interop/version.json +# jobs: +# run-transport-interop: +# name: Run transport interoperability tests +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v4 +# - uses: docker/setup-buildx-action@v3 +# - name: Build image +# run: docker buildx build --load -t nim-libp2p-head -f tests/transport-interop/Dockerfile . +# - name: Run tests +# uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master +# with: +# test-filter: nim-libp2p-head +# extra-versions: ${{ github.workspace }}/tests/transport-interop/version.json - run-hole-punching-interop: - name: Run hole-punching interoperability tests - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: Build image - run: docker buildx build --load -t nim-libp2p-head -f tests/hole-punching-interop/Dockerfile . - - name: Run tests - uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master - with: - test-filter: nim-libp2p-head - extra-versions: ${{ github.workspace }}/tests/hole-punching-interop/version.json +# run-hole-punching-interop: +# name: Run hole-punching interoperability tests +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v4 +# - uses: docker/setup-buildx-action@v3 +# - name: Build image +# run: docker buildx build --load -t nim-libp2p-head -f tests/hole-punching-interop/Dockerfile . +# - name: Run tests +# uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master +# with: +# test-filter: nim-libp2p-head +# extra-versions: ${{ github.workspace }}/tests/hole-punching-interop/version.json From f9dd31e0984b1bc16bc6342f116cd9260e216a78 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 13:09:15 +0200 Subject: [PATCH 35/70] wip --- .github/workflows/base_daily.yml | 85 +++++++++++++++++++++++++++++++ .github/workflows/base_tests.yml | 37 +++++--------- .github/workflows/daily_devel.yml | 2 +- 3 files changed, 100 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/base_daily.yml diff --git a/.github/workflows/base_daily.yml b/.github/workflows/base_daily.yml new file mode 100644 index 0000000000..79d0cba0ae --- /dev/null +++ b/.github/workflows/base_daily.yml @@ -0,0 +1,85 @@ +# name: daily-common + +# on: +# workflow_call: +# inputs: +# nim-branch: +# description: 'Nim branch' +# required: true +# type: string +# cpu: +# description: 'CPU' +# required: true +# type: string +# exclude: +# description: 'Exclude matrix configurations' +# required: false +# type: string +# default: "[]" + +# jobs: +# delete_cache: +# name: Delete github action's branch cache +# runs-on: ubuntu-latest +# steps: +# - uses: snnaplab/delete-branch-cache-action@v1 + +# build: +# needs: delete_cache +# timeout-minutes: 90 +# strategy: +# fail-fast: false +# matrix: +# platform: +# - os: linux +# builder: ubuntu-22.04 +# shell: bash +# - os: macos +# builder: macos-13 +# shell: bash +# - os: windows +# builder: windows-2022 +# shell: msys2 {0} +# branch: ${{ fromJSON(inputs.nim-branch) }} +# cpu: ${{ fromJSON(inputs.cpu) }} +# exclude: ${{ fromJSON(inputs.exclude) }} + +# defaults: +# run: +# shell: ${{ matrix.platform.shell }} + +# name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.branch }})' +# runs-on: ${{ matrix.platform.builder }} +# continue-on-error: ${{ matrix.branch == 'devel' || matrix.branch == 'version-2-0' }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 + +# - name: Setup Nim +# uses: "./.github/actions/install_nim" +# with: +# os: ${{ matrix.platform.os }} +# shell: ${{ matrix.platform.shell }} +# nim_branch: ${{ matrix.branch }} +# cpu: ${{ matrix.cpu }} + +# - name: Setup Go +# uses: actions/setup-go@v4 +# with: +# go-version: '~1.15.5' +# cache: false + +# - name: Install p2pd +# run: | +# V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 + +# - name: Run tests +# run: | +# nim --version +# nimble --version +# nimble install -y --depsOnly +# NIMFLAGS="${NIMFLAGS} --mm:refc" nimble test +# if [[ "${{ matrix.branch }}" == "devel" ]]; then +# echo -e "\nTesting with '--mm:orc':\n" +# NIMFLAGS="${NIMFLAGS} --mm:orc" nimble test +# fi \ No newline at end of file diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 5a1865426d..241facba27 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -38,35 +38,26 @@ jobs: platform: - os: linux cpu: amd64 + builder: ubuntu-22.04 + shell: bash - os: linux cpu: i386 + builder: ubuntu-22.04 + shell: bash - os: macos cpu: amd64 + builder: macos-13 + shell: bash - os: windows cpu: amd64 - nim_branch: ${{ inputs.exclude != 0 && fromJSON(inputs.nim_branch) || fromJSON("[{'version': 'version-1-6'}, {'version': 'version-2-0'}]") }} - include: - - platform: - os: linux - builder: ubuntu-22.04 - shell: bash - - platform: - os: macos - builder: macos-13 - shell: bash - - platform: - os: windows - builder: windows-2022 - shell: msys2 {0}ve - - nim_branch: - version: version-1-6 - memory_management: refc - - nim_branch: - version: version-2-0 - memory_management: refc - - nim_branch: - version: devel - memory_management: orc + builder: windows-2022 + shell: msys2 {0} + nim_branch: + - version: version-1-6 + memory_management: refc + - version: version-2-0 + memory_management: refc + - ${{ fromJson(inputs.nim_branch) }} # If exclude is defined then use its value, otherwise default to empty list (as declared on workflow_call.inputs). # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 4b3cfdc6d1..34865bbece 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -10,5 +10,5 @@ jobs: name: Daily Nim Devel uses: ./.github/workflows/base_tests.yml with: - include: "[{'nim_branch': {'version': 'devel', 'memory_management': 'orc'}}]" + nim_branch: "[{'version': 'devel', 'memory_management': 'orc'}]" exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" From e7f551f8be05be8f7b1721e059077f075331c880 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 14:53:29 +0200 Subject: [PATCH 36/70] wip --- .github/workflows/base_daily.yml | 85 -------------------------- .github/workflows/base_daily_tests.yml | 84 +++++++++++++++++++++++++ .github/workflows/base_tests.yml | 2 +- .github/workflows/daily_amd64.yml | 5 +- .github/workflows/daily_devel.yml | 4 +- .github/workflows/daily_i386.yml | 8 ++- 6 files changed, 95 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/base_daily.yml create mode 100644 .github/workflows/base_daily_tests.yml diff --git a/.github/workflows/base_daily.yml b/.github/workflows/base_daily.yml deleted file mode 100644 index 79d0cba0ae..0000000000 --- a/.github/workflows/base_daily.yml +++ /dev/null @@ -1,85 +0,0 @@ -# name: daily-common - -# on: -# workflow_call: -# inputs: -# nim-branch: -# description: 'Nim branch' -# required: true -# type: string -# cpu: -# description: 'CPU' -# required: true -# type: string -# exclude: -# description: 'Exclude matrix configurations' -# required: false -# type: string -# default: "[]" - -# jobs: -# delete_cache: -# name: Delete github action's branch cache -# runs-on: ubuntu-latest -# steps: -# - uses: snnaplab/delete-branch-cache-action@v1 - -# build: -# needs: delete_cache -# timeout-minutes: 90 -# strategy: -# fail-fast: false -# matrix: -# platform: -# - os: linux -# builder: ubuntu-22.04 -# shell: bash -# - os: macos -# builder: macos-13 -# shell: bash -# - os: windows -# builder: windows-2022 -# shell: msys2 {0} -# branch: ${{ fromJSON(inputs.nim-branch) }} -# cpu: ${{ fromJSON(inputs.cpu) }} -# exclude: ${{ fromJSON(inputs.exclude) }} - -# defaults: -# run: -# shell: ${{ matrix.platform.shell }} - -# name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.branch }})' -# runs-on: ${{ matrix.platform.builder }} -# continue-on-error: ${{ matrix.branch == 'devel' || matrix.branch == 'version-2-0' }} -# steps: -# - name: Checkout -# uses: actions/checkout@v4 - -# - name: Setup Nim -# uses: "./.github/actions/install_nim" -# with: -# os: ${{ matrix.platform.os }} -# shell: ${{ matrix.platform.shell }} -# nim_branch: ${{ matrix.branch }} -# cpu: ${{ matrix.cpu }} - -# - name: Setup Go -# uses: actions/setup-go@v4 -# with: -# go-version: '~1.15.5' -# cache: false - -# - name: Install p2pd -# run: | -# V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 - -# - name: Run tests -# run: | -# nim --version -# nimble --version -# nimble install -y --depsOnly -# NIMFLAGS="${NIMFLAGS} --mm:refc" nimble test -# if [[ "${{ matrix.branch }}" == "devel" ]]; then -# echo -e "\nTesting with '--mm:orc':\n" -# NIMFLAGS="${NIMFLAGS} --mm:orc" nimble test -# fi \ No newline at end of file diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml new file mode 100644 index 0000000000..83760a6c02 --- /dev/null +++ b/.github/workflows/base_daily_tests.yml @@ -0,0 +1,84 @@ +name: Base Daily Tests + +on: + workflow_call: + inputs: + nim: + description: 'Nim Branch' + required: true + type: string # Following this format: [{"branch": ..., "memory_management": ...}, ...] + cpu: + description: 'CPU' + required: true + type: string + exclude: + description: 'Exclude matrix configurations' + required: false + type: string + default: "[]" + +jobs: + delete_cache: + name: Delete github action's branch cache + runs-on: ubuntu-latest + steps: + - uses: snnaplab/delete-branch-cache-action@v1 + + test: + needs: delete_cache + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + platform: + - os: linux + builder: ubuntu-22.04 + shell: bash + - os: macos + builder: macos-13 + shell: bash + - os: windows + builder: windows-2022 + shell: msys2 {0} + nim: ${{ fromJSON(inputs.nim) }} + cpu: ${{ fromJSON(inputs.cpu) }} + exclude: ${{ fromJSON(inputs.exclude) }} + + defaults: + run: + shell: ${{ matrix.platform.shell }} + + name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.version }})' + runs-on: ${{ matrix.platform.builder }} + continue-on-error: ${{ matrix.branch == 'devel' || matrix.branch == 'version-2-0' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Nim + uses: "./.github/actions/install_nim" + with: + os: ${{ matrix.platform.os }} + shell: ${{ matrix.platform.shell }} + nim_branch: ${{ matrix.nim.branch }} + cpu: ${{ matrix.cpu }} + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '~1.15.5' + cache: false + + - name: Install p2pd + run: | + V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 + + - name: Install dependencies + run: | + nimble install -y --depsOnly + + - name: Run tests + run: | + nim --version + nimble --version + NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" nimble test diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 241facba27..47ce8f8454 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -9,7 +9,7 @@ on: inputs: nim_branch: description: 'Nim branch configurations' - required: true + required: false type: string default: "[]" exclude: diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index c71395e37f..29fef78b99 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -8,6 +8,7 @@ on: jobs: test_amd64: name: Daily amd64 - uses: ./.github/workflows/base_tests.yml + uses: ./.github/workflows/base_daily_tests.yml with: - exclude: "[{'platform': {'cpu': 'i386'}}]" + nim_branch: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}]" + cpu: "['amd64']" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 34865bbece..7c26c3606a 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -8,7 +8,7 @@ on: jobs: test_nim_devel: name: Daily Nim Devel - uses: ./.github/workflows/base_tests.yml + uses: ./.github/workflows/base_daily_tests.yml with: nim_branch: "[{'version': 'devel', 'memory_management': 'orc'}]" - exclude: "[{'platform': {'os': 'windows'}}, {'platform': {'os': 'macos'}}, {'platform': {'cpu': 'i386'}}]" + cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 998f5bb769..a4a7688a88 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -7,7 +7,9 @@ on: jobs: test_i386: - name: Daily i386 - uses: ./.github/workflows/base_tests.yml + name: Daily i386 (Linux) + uses: ./.github/workflows/base_daily_tests.yml with: - exclude: "[{'platform': {'cpu': 'amd64'}, 'nim_branch': {'version': 'version-2-0'}}]" + nim_branch: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}, {'version': 'devel', 'memory_management': 'orc'}]" + cpu: "['i386']" + exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" From dd21a3e7b2e6e13f4ef8cf7c7c7b5bcecb37bd54 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 14:56:04 +0200 Subject: [PATCH 37/70] wip --- .github/workflows/base_daily_tests.yml | 4 ++-- .github/workflows/daily_amd64.yml | 2 +- .github/workflows/daily_devel.yml | 2 +- .github/workflows/daily_i386.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 83760a6c02..6b0e52bf9a 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -48,9 +48,9 @@ jobs: run: shell: ${{ matrix.platform.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.version }})' + name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' runs-on: ${{ matrix.platform.builder }} - continue-on-error: ${{ matrix.branch == 'devel' || matrix.branch == 'version-2-0' }} + continue-on-error: ${{ matrix.nim.branch == 'devel' || matrix.nim.branch == 'version-2-0' }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index 29fef78b99..48886d2d50 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -10,5 +10,5 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_daily_tests.yml with: - nim_branch: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}]" + nim: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}]" cpu: "['amd64']" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 7c26c3606a..13d0bd8088 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -10,5 +10,5 @@ jobs: name: Daily Nim Devel uses: ./.github/workflows/base_daily_tests.yml with: - nim_branch: "[{'version': 'devel', 'memory_management': 'orc'}]" + nim: "[{'version': 'devel', 'memory_management': 'orc'}]" cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index a4a7688a88..990c077d50 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -10,6 +10,6 @@ jobs: name: Daily i386 (Linux) uses: ./.github/workflows/base_daily_tests.yml with: - nim_branch: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}, {'version': 'devel', 'memory_management': 'orc'}]" + nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" cpu: "['i386']" exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" From 90fcc8130444ec9340719b436b2217e9098e61aa Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:02:29 +0200 Subject: [PATCH 38/70] wip --- .github/workflows/daily_amd64.yml | 2 +- .github/workflows/daily_devel.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index 48886d2d50..b10c461cfd 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -10,5 +10,5 @@ jobs: name: Daily amd64 uses: ./.github/workflows/base_daily_tests.yml with: - nim: "[{'version': 'version-1-6', 'memory_management': 'refc'}, {'version': 'version-2-0', 'memory_management': 'refc'}]" + nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" cpu: "['amd64']" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 13d0bd8088..182bee9d81 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -10,5 +10,5 @@ jobs: name: Daily Nim Devel uses: ./.github/workflows/base_daily_tests.yml with: - nim: "[{'version': 'devel', 'memory_management': 'orc'}]" + nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" cpu: "['amd64']" From 47a5ef8f26fdd7ea8b1a258753a61860470b34d5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:27:10 +0200 Subject: [PATCH 39/70] wip --- .github/workflows/base_daily_tests.yml | 4 +++ .github/workflows/base_tests.yml | 36 +++++++------------------- .github/workflows/daily_amd64.yml | 26 +++++++++---------- .github/workflows/daily_devel.yml | 26 +++++++++---------- .github/workflows/daily_i386.yml | 28 ++++++++++---------- 5 files changed, 54 insertions(+), 66 deletions(-) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 6b0e52bf9a..6dea8e898c 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -17,6 +17,10 @@ on: type: string default: "[]" +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.job }} + cancel-in-progress: true + jobs: delete_cache: name: Delete github action's branch cache diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 47ce8f8454..ba0e643027 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -6,17 +6,6 @@ on: - master pull_request: workflow_call: - inputs: - nim_branch: - description: 'Nim branch configurations' - required: false - type: string - default: "[]" - exclude: - description: 'Exclude matrix configurations' - required: false - type: string - default: "[]" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -38,32 +27,27 @@ jobs: platform: - os: linux cpu: amd64 - builder: ubuntu-22.04 - shell: bash - os: linux cpu: i386 - builder: ubuntu-22.04 - shell: bash - os: macos cpu: amd64 - builder: macos-13 - shell: bash - os: windows cpu: amd64 - builder: windows-2022 - shell: msys2 {0} nim_branch: - version: version-1-6 memory_management: refc - version: version-2-0 memory_management: refc - - ${{ fromJson(inputs.nim_branch) }} - - # If exclude is defined then use its value, otherwise default to empty list (as declared on workflow_call.inputs). - # Reason for above is when workflow is not initiated by workflow_call, the parameters are not defined. Their value is 0 or '' (empty string). - # This relies on the value 0 meaning the parameter was not filled in. - # exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} - exclude: ${{ inputs.exclude != 0 && fromJSON(inputs.exclude) || fromJSON('[]') }} + include: + - os: linux + builder: ubuntu-22.04 + shell: bash + - os: macos + builder: macos-13 + shell: bash + - os: windows + builder: windows-2022 + shell: msys {0} defaults: run: diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index b10c461cfd..3e112c75dd 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -1,14 +1,14 @@ -name: Daily amd64 -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - pull_request: +# name: Daily amd64 +# on: +# schedule: +# - cron: "30 6 * * *" +# workflow_dispatch: +# pull_request: -jobs: - test_amd64: - name: Daily amd64 - uses: ./.github/workflows/base_daily_tests.yml - with: - nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" - cpu: "['amd64']" +# jobs: +# test_amd64: +# name: Daily amd64 +# uses: ./.github/workflows/base_daily_tests.yml +# with: +# nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" +# cpu: "['amd64']" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 182bee9d81..7d2d24be51 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -1,14 +1,14 @@ -name: Daily Nim Devel -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - pull_request: +# name: Daily Nim Devel +# on: +# schedule: +# - cron: "30 6 * * *" +# workflow_dispatch: +# pull_request: -jobs: - test_nim_devel: - name: Daily Nim Devel - uses: ./.github/workflows/base_daily_tests.yml - with: - nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" - cpu: "['amd64']" +# jobs: +# test_nim_devel: +# name: Daily Nim Devel +# uses: ./.github/workflows/base_daily_tests.yml +# with: +# nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" +# cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 990c077d50..7a51b6bbcb 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -1,15 +1,15 @@ -name: Daily i386 -on: - schedule: - - cron: "30 6 * * *" - workflow_dispatch: - pull_request: +# name: Daily i386 +# on: +# schedule: +# - cron: "30 6 * * *" +# workflow_dispatch: +# pull_request: -jobs: - test_i386: - name: Daily i386 (Linux) - uses: ./.github/workflows/base_daily_tests.yml - with: - nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" - cpu: "['i386']" - exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" +# jobs: +# test_i386: +# name: Daily i386 (Linux) +# uses: ./.github/workflows/base_daily_tests.yml +# with: +# nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" +# cpu: "['i386']" +# exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" From 29e2868bab544557f0c66f4cf0281e8ee7668497 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:30:38 +0200 Subject: [PATCH 40/70] wip --- .github/workflows/base_tests.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index ba0e643027..5e70e8c30c 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -39,15 +39,16 @@ jobs: - version: version-2-0 memory_management: refc include: - - os: linux - builder: ubuntu-22.04 - shell: bash - - os: macos - builder: macos-13 - shell: bash - - os: windows - builder: windows-2022 - shell: msys {0} + - platform: + - os: linux + builder: ubuntu-22.04 + shell: bash + - os: macos + builder: macos-13 + shell: bash + - os: windows + builder: windows-2022 + shell: msys {0} defaults: run: From 57c578633178cfcc4364ba9c05ca637a989e8a51 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:31:26 +0200 Subject: [PATCH 41/70] wip --- .github/workflows/base_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 5e70e8c30c..30e60b8210 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -43,9 +43,11 @@ jobs: - os: linux builder: ubuntu-22.04 shell: bash + - platform: - os: macos builder: macos-13 shell: bash + - platform: - os: windows builder: windows-2022 shell: msys {0} From c73111621b3b9688065f95126fc65df2461ab77a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:36:47 +0200 Subject: [PATCH 42/70] wip --- .github/workflows/base_tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 30e60b8210..8bc7d7cd97 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -41,16 +41,16 @@ jobs: include: - platform: - os: linux - builder: ubuntu-22.04 - shell: bash + builder: ubuntu-22.04 + shell: bash - platform: - os: macos - builder: macos-13 - shell: bash + builder: macos-13 + shell: bash - platform: - os: windows - builder: windows-2022 - shell: msys {0} + builder: windows-2022 + shell: msys {0} defaults: run: From 8b08e3c75f0ec58e0afd769f7065f55f18513b56 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:37:24 +0200 Subject: [PATCH 43/70] wip --- .github/workflows/base_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 8bc7d7cd97..fbe3d1eda2 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -40,15 +40,15 @@ jobs: memory_management: refc include: - platform: - - os: linux + - os: linux builder: ubuntu-22.04 shell: bash - platform: - - os: macos + - os: macos builder: macos-13 shell: bash - platform: - - os: windows + - os: windows builder: windows-2022 shell: msys {0} From ac0265cf8583e4980ac5d35dc12d159ed5a577c5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:38:00 +0200 Subject: [PATCH 44/70] wip --- .github/workflows/base_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index fbe3d1eda2..b784e32c50 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -40,15 +40,15 @@ jobs: memory_management: refc include: - platform: - - os: linux + os: linux builder: ubuntu-22.04 shell: bash - platform: - - os: macos + os: macos builder: macos-13 shell: bash - platform: - - os: windows + os: windows builder: windows-2022 shell: msys {0} From a36dcc06d8efdb252531af79280177c2651fad1a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:39:03 +0200 Subject: [PATCH 45/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index b784e32c50..fa6febc871 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -57,7 +57,7 @@ jobs: shell: ${{ matrix.platform.shell }} # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.platform.builder }}-${{ matrix.platform.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' runs-on: ubuntu-22.04 continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: From 142e87ed84d5fc3d7ece8f7286ab37b70ea92e0d Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:40:09 +0200 Subject: [PATCH 46/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index fa6febc871..4162151363 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -54,7 +54,7 @@ jobs: defaults: run: - shell: ${{ matrix.platform.shell }} + shell: ${{ matrix.shell }} # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' From e10976bcd06b697eecba5c098bf34ee634afe21a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:41:14 +0200 Subject: [PATCH 47/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 4162151363..3cf00ab594 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -58,7 +58,7 @@ jobs: # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.builder }} continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} steps: - name: Matrix info From 943214b3885e74eb8afdf0167ede4f53921a856d Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:42:48 +0200 Subject: [PATCH 48/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 3cf00ab594..3da2d132be 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -50,7 +50,7 @@ jobs: - platform: os: windows builder: windows-2022 - shell: msys {0} + shell: msys2 {0} defaults: run: From ed0eada2174b5381f7e376a85dbf7ceeeb233441 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 15:48:46 +0200 Subject: [PATCH 49/70] wip --- .github/workflows/base_tests.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 3da2d132be..47a9ee26e3 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -33,10 +33,10 @@ jobs: cpu: amd64 - os: windows cpu: amd64 - nim_branch: - - version: version-1-6 + nim: + - branch: version-1-6 memory_management: refc - - version: version-2-0 + - branch: version-2-0 memory_management: refc include: - platform: @@ -56,10 +56,10 @@ jobs: run: shell: ${{ matrix.shell }} - # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim_branch.version }})' - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim_branch.version }}-${{ matrix.nim_branch.memory_management }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' + # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim.branch }}-${{ matrix.nim.memory_management }})' runs-on: ${{ matrix.builder }} - continue-on-error: ${{ matrix.nim_branch.version == 'version-2-0' || matrix.nim_branch.version == 'devel' }} + continue-on-error: ${{ matrix.nim.branch == 'version-2-0' || matrix.nim.branch == 'devel' }} steps: - name: Matrix info run: "" @@ -74,7 +74,7 @@ jobs: # with: # os: ${{ matrix.platform.os }} # shell: ${{ matrix.platform.shell }} - # nim_branch: ${{ matrix.nim_branch.version }} + # nim: ${{ matrix.nim.branch }} # cpu: ${{ matrix.platform.cpu }} # - name: Setup Go @@ -95,6 +95,6 @@ jobs: # run: | # nim --version # nimble --version - # NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim_branch.memory_management }}" + # NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" # nimble test From 249aba9eaded59f0e712da1dc20a0d2b16fe9a00 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 17:44:18 +0200 Subject: [PATCH 50/70] wip --- .github/workflows/base_tests.yml | 2 +- .github/workflows/msys2.yml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 47a9ee26e3..32c7115865 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -49,7 +49,7 @@ jobs: shell: bash - platform: os: windows - builder: windows-2022 + builder: windows-latest shell: msys2 {0} defaults: diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000000..75b37e7691 --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,19 @@ +name: MSYS2 +on: [push, pull_request] + +jobs: + msys2-ucrt64: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + # - uses: msys2/setup-msys2@v2 + # with: + # msystem: UCRT64 + # update: true + # install: git mingw-w64-ucrt-x86_64-gcc + - name: CI-Build + run: | + echo 'Running in MSYS2!' From 9bd17f9837f7414c30181d7e401abb314333ddc5 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 17:47:10 +0200 Subject: [PATCH 51/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 32c7115865..99c8ca1a96 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -54,7 +54,7 @@ jobs: defaults: run: - shell: ${{ matrix.shell }} + shell: msys2 {0} name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim.branch }}-${{ matrix.nim.memory_management }})' From 6be966d8c5e1c657915bddbbc8460b7fc4a1ea45 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 19:00:45 +0200 Subject: [PATCH 52/70] wip --- .github/workflows/daily_devel.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 7d2d24be51..182bee9d81 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -1,14 +1,14 @@ -# name: Daily Nim Devel -# on: -# schedule: -# - cron: "30 6 * * *" -# workflow_dispatch: -# pull_request: +name: Daily Nim Devel +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: -# jobs: -# test_nim_devel: -# name: Daily Nim Devel -# uses: ./.github/workflows/base_daily_tests.yml -# with: -# nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" -# cpu: "['amd64']" +jobs: + test_nim_devel: + name: Daily Nim Devel + uses: ./.github/workflows/base_daily_tests.yml + with: + nim: "[{'branch': 'devel', 'memory_management': 'orc'}]" + cpu: "['amd64']" From 2409e9ef9158e6db57d7c808e03ec0bc4fe99558 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 19:39:12 +0200 Subject: [PATCH 53/70] wip --- .github/workflows/base_tests.yml | 6 +++++- .github/workflows/msys2.yml | 19 ------------------- 2 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 99c8ca1a96..2f61508507 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -27,12 +27,16 @@ jobs: platform: - os: linux cpu: amd64 + shell: bash - os: linux cpu: i386 + shell: bash - os: macos cpu: amd64 + shell: bash - os: windows cpu: amd64 + shell: msys {0} nim: - branch: version-1-6 memory_management: refc @@ -54,7 +58,7 @@ jobs: defaults: run: - shell: msys2 {0} + shell: ${{ matrix.platform.shell }} name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim.branch }}-${{ matrix.nim.memory_management }})' diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml deleted file mode 100644 index 75b37e7691..0000000000 --- a/.github/workflows/msys2.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: MSYS2 -on: [push, pull_request] - -jobs: - msys2-ucrt64: - runs-on: windows-latest - defaults: - run: - shell: msys2 {0} - steps: - - uses: actions/checkout@v3 - # - uses: msys2/setup-msys2@v2 - # with: - # msystem: UCRT64 - # update: true - # install: git mingw-w64-ucrt-x86_64-gcc - - name: CI-Build - run: | - echo 'Running in MSYS2!' From 6f1c2d9372565494387417376a63d8912f5d5ac8 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 21:14:47 +0200 Subject: [PATCH 54/70] wip --- .github/workflows/base_tests.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 2f61508507..8720479101 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -65,21 +65,18 @@ jobs: runs-on: ${{ matrix.builder }} continue-on-error: ${{ matrix.nim.branch == 'version-2-0' || matrix.nim.branch == 'devel' }} steps: - - name: Matrix info - run: "" + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # submodules: true - - # - name: Setup Nim - # uses: "./.github/actions/install_nim" - # with: - # os: ${{ matrix.platform.os }} - # shell: ${{ matrix.platform.shell }} - # nim: ${{ matrix.nim.branch }} - # cpu: ${{ matrix.platform.cpu }} + - name: Setup Nim + uses: "./.github/actions/install_nim" + with: + os: ${{ matrix.platform.os }} + shell: ${{ matrix.platform.shell }} + nim: ${{ matrix.nim.branch }} + cpu: ${{ matrix.platform.cpu }} # - name: Setup Go # uses: actions/setup-go@v5 From 2b4dee4c620deae05c0a75322f2160b8dfce557a Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 21:51:43 +0200 Subject: [PATCH 55/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 8720479101..fb49c79bd0 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -75,7 +75,7 @@ jobs: with: os: ${{ matrix.platform.os }} shell: ${{ matrix.platform.shell }} - nim: ${{ matrix.nim.branch }} + nim_branch: ${{ matrix.nim.branch }} cpu: ${{ matrix.platform.cpu }} # - name: Setup Go From e06d60e5d983f01fcef7f82b213d2b2750e74aec Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 22:18:23 +0200 Subject: [PATCH 56/70] wip --- .github/workflows/base_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index fb49c79bd0..a4a500d0d5 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -36,7 +36,7 @@ jobs: shell: bash - os: windows cpu: amd64 - shell: msys {0} + shell: msys2 {0} nim: - branch: version-1-6 memory_management: refc From 7afc4358eb4885772db95fbcd112c0809f71b2c0 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 22:32:45 +0200 Subject: [PATCH 57/70] wip --- .github/workflows/base_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index a4a500d0d5..5653b45807 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -58,7 +58,7 @@ jobs: defaults: run: - shell: ${{ matrix.platform.shell }} + shell: ${{ matrix.shell }} name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim.branch }}-${{ matrix.nim.memory_management }})' @@ -74,7 +74,7 @@ jobs: uses: "./.github/actions/install_nim" with: os: ${{ matrix.platform.os }} - shell: ${{ matrix.platform.shell }} + shell: ${{ matrix.shell }} nim_branch: ${{ matrix.nim.branch }} cpu: ${{ matrix.platform.cpu }} From 5d20e017c2d84fa3dc6126957d71774cbe4a0ce0 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 19 Jul 2024 23:07:51 +0200 Subject: [PATCH 58/70] wip --- .github/workflows/base_daily_tests.yml | 2 +- .github/workflows/base_tests.yml | 36 +++++----- .github/workflows/coverage.yml | 99 +++++++++++++------------- .github/workflows/daily_amd64.yml | 26 +++---- .github/workflows/daily_i386.yml | 28 ++++---- .github/workflows/interop.yml | 54 +++++++------- 6 files changed, 121 insertions(+), 124 deletions(-) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 6dea8e898c..947af8cce0 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -68,7 +68,7 @@ jobs: cpu: ${{ matrix.cpu }} - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '~1.15.5' cache: false diff --git a/.github/workflows/base_tests.yml b/.github/workflows/base_tests.yml index 5653b45807..09cebe4602 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/base_tests.yml @@ -61,7 +61,6 @@ jobs: shell: ${{ matrix.shell }} name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' - # name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }}-${{ matrix.builder }}-${{ matrix.shell }} (Nim ${{ matrix.nim.branch }}-${{ matrix.nim.memory_management }})' runs-on: ${{ matrix.builder }} continue-on-error: ${{ matrix.nim.branch == 'version-2-0' || matrix.nim.branch == 'devel' }} steps: @@ -78,24 +77,23 @@ jobs: nim_branch: ${{ matrix.nim.branch }} cpu: ${{ matrix.platform.cpu }} - # - name: Setup Go - # uses: actions/setup-go@v5 - # with: - # go-version: '~1.15.5' - # cache: false + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '~1.15.5' + cache: false - # - name: Install p2pd - # run: | - # V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 + - name: Install p2pd + run: | + V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 - # - name: Install deps - # run: | - # nimble install -y --depsOnly - - # - name: Run tests - # run: | - # nim --version - # nimble --version - # NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" - # nimble test + - name: Install deps + run: | + nimble install -y --depsOnly + - name: Run tests + run: | + nim --version + nimble --version + NIMFLAGS="${NIMFLAGS} --mm:${{ matrix.nim.memory_management }}" + nimble test diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 52489ccd69..60d00d1794 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -12,60 +12,59 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -# jobs: -# codecov: -# # Improvement: Split single job into run tests, generate coverage, and upload to codecov. -# name: Run coverage and upload to codecov -# runs-on: ubuntu-22.04 -# env: -# CICOV: YES -# steps: -# - uses: actions/checkout@v4 -# with: -# fetch-depth: 0 +jobs: + codecov: + # Improvement: Split single job into run tests, generate coverage, and upload to codecov. + name: Run coverage and upload to codecov + runs-on: ubuntu-22.04 + env: + CICOV: YES + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 -# - name: Setup Nim -# uses: "./.github/actions/install_nim" -# with: -# os: linux -# cpu: amd64 -# shell: bash + - name: Setup Nim + uses: "./.github/actions/install_nim" + with: + os: linux + cpu: amd64 + shell: bash -# - name: Restore deps from cache -# id: deps-cache -# uses: actions/cache@v4 -# with: -# path: nimbledeps -# key: nimbledeps-${{ hashFiles('.pinned') }} + - name: Restore deps from cache + id: deps-cache + uses: actions/cache@v4 + with: + path: nimbledeps + key: nimbledeps-${{ hashFiles('.pinned') }} -# - name: Install deps -# if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} -# run: | -# nimble install_pinned + - name: Install deps + if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} + run: | + nimble install_pinned -# - name: Install coverage tools and setup -# run: | -# sudo apt-get update -# sudo apt-get install -y lcov build-essential git curl -# mkdir coverage + - name: Install coverage tools and setup + run: | + sudo apt-get update + sudo apt-get install -y lcov build-essential git curl + mkdir coverage -# - name: Run coverage-enabled test suite -# run: | -# export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" -# nimble testnative -# nimble testpubsub -# nimble testfilter + - name: Run coverage-enabled test suite + run: | + export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" + nimble testnative + nimble testpubsub + nimble testfilter -# - name: Run coverage -# run: | -# find nimcache -name *.c -delete -# lcov --capture --directory nimcache --output-file coverage/coverage.info -# shopt -s globstar -# ls `pwd`/libp2p/{*,**/*}.nim -# lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info -# genhtml coverage/coverage.f.info --output-directory coverage/output + - name: Run coverage + run: | + find nimcache -name *.c -delete + lcov --capture --directory nimcache --output-file coverage/coverage.info + shopt -s globstar + ls `pwd`/libp2p/{*,**/*}.nim + lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info + genhtml coverage/coverage.f.info --output-directory coverage/output -# - name: Upload coverage to codecov -# run: | -# bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" - + - name: Upload coverage to codecov + run: | + bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index 3e112c75dd..b10c461cfd 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -1,14 +1,14 @@ -# name: Daily amd64 -# on: -# schedule: -# - cron: "30 6 * * *" -# workflow_dispatch: -# pull_request: +name: Daily amd64 +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: -# jobs: -# test_amd64: -# name: Daily amd64 -# uses: ./.github/workflows/base_daily_tests.yml -# with: -# nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" -# cpu: "['amd64']" +jobs: + test_amd64: + name: Daily amd64 + uses: ./.github/workflows/base_daily_tests.yml + with: + nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}]" + cpu: "['amd64']" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 7a51b6bbcb..990c077d50 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -1,15 +1,15 @@ -# name: Daily i386 -# on: -# schedule: -# - cron: "30 6 * * *" -# workflow_dispatch: -# pull_request: +name: Daily i386 +on: + schedule: + - cron: "30 6 * * *" + workflow_dispatch: + pull_request: -# jobs: -# test_i386: -# name: Daily i386 (Linux) -# uses: ./.github/workflows/base_daily_tests.yml -# with: -# nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" -# cpu: "['i386']" -# exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" +jobs: + test_i386: + name: Daily i386 (Linux) + uses: ./.github/workflows/base_daily_tests.yml + with: + nim: "[{'branch': 'version-1-6', 'memory_management': 'refc'}, {'branch': 'version-2-0', 'memory_management': 'refc'}, {'branch': 'devel', 'memory_management': 'orc'}]" + cpu: "['i386']" + exclude: "[{'platform': {'os':'macos'}}, {'platform': {'os':'windows'}}]" diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 830e6d8eb5..c9a6853626 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -10,31 +10,31 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -# jobs: -# run-transport-interop: -# name: Run transport interoperability tests -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v4 -# - uses: docker/setup-buildx-action@v3 -# - name: Build image -# run: docker buildx build --load -t nim-libp2p-head -f tests/transport-interop/Dockerfile . -# - name: Run tests -# uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master -# with: -# test-filter: nim-libp2p-head -# extra-versions: ${{ github.workspace }}/tests/transport-interop/version.json +jobs: + run-transport-interop: + name: Run transport interoperability tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: Build image + run: docker buildx build --load -t nim-libp2p-head -f tests/transport-interop/Dockerfile . + - name: Run tests + uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master + with: + test-filter: nim-libp2p-head + extra-versions: ${{ github.workspace }}/tests/transport-interop/version.json -# run-hole-punching-interop: -# name: Run hole-punching interoperability tests -# runs-on: ubuntu-22.04 -# steps: -# - uses: actions/checkout@v4 -# - uses: docker/setup-buildx-action@v3 -# - name: Build image -# run: docker buildx build --load -t nim-libp2p-head -f tests/hole-punching-interop/Dockerfile . -# - name: Run tests -# uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master -# with: -# test-filter: nim-libp2p-head -# extra-versions: ${{ github.workspace }}/tests/hole-punching-interop/version.json + run-hole-punching-interop: + name: Run hole-punching interoperability tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: Build image + run: docker buildx build --load -t nim-libp2p-head -f tests/hole-punching-interop/Dockerfile . + - name: Run tests + uses: libp2p/test-plans/.github/actions/run-interop-hole-punch-test@master + with: + test-filter: nim-libp2p-head + extra-versions: ${{ github.workspace }}/tests/hole-punching-interop/version.json From 614d35789de756cb519205b5d4b24b9aaa1c2741 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 13:07:47 +0200 Subject: [PATCH 59/70] wip --- .github/workflows/base_daily_tests.yml | 4 ++-- .../{base_tests.yml => continuous_integration.yml} | 8 +------- .github/workflows/coverage.yml | 5 ++--- .github/workflows/{linter.yml => linters.yml} | 13 +++++++------ 4 files changed, 12 insertions(+), 18 deletions(-) rename .github/workflows/{base_tests.yml => continuous_integration.yml} (92%) rename .github/workflows/{linter.yml => linters.yml} (78%) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 947af8cce0..8256b2532a 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: nim: - description: 'Nim Branch' + description: 'Nim Configuration' required: true type: string # Following this format: [{"branch": ..., "memory_management": ...}, ...] cpu: @@ -18,7 +18,7 @@ on: default: "[]" concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.job }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: diff --git a/.github/workflows/base_tests.yml b/.github/workflows/continuous_integration.yml similarity index 92% rename from .github/workflows/base_tests.yml rename to .github/workflows/continuous_integration.yml index 09cebe4602..8582c41619 100644 --- a/.github/workflows/base_tests.yml +++ b/.github/workflows/continuous_integration.yml @@ -1,4 +1,4 @@ -name: Base Tests +name: Continuous Integration on: push: @@ -12,12 +12,6 @@ concurrency: cancel-in-progress: true jobs: - delete_cache: - name: Delete github action's branch cache - runs-on: ubuntu-latest - steps: - - uses: snnaplab/delete-branch-cache-action@v1 - test: needs: delete_cache timeout-minutes: 90 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 60d00d1794..b06013cdfa 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,6 @@ concurrency: jobs: codecov: - # Improvement: Split single job into run tests, generate coverage, and upload to codecov. name: Run coverage and upload to codecov runs-on: ubuntu-22.04 env: @@ -43,13 +42,13 @@ jobs: run: | nimble install_pinned - - name: Install coverage tools and setup + - name: Setup coverage run: | sudo apt-get update sudo apt-get install -y lcov build-essential git curl mkdir coverage - - name: Run coverage-enabled test suite + - name: Run test suite with coverage flags run: | export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage" nimble testnative diff --git a/.github/workflows/linter.yml b/.github/workflows/linters.yml similarity index 78% rename from .github/workflows/linter.yml rename to .github/workflows/linters.yml index e56106eb8b..e572d11cdb 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linters.yml @@ -12,20 +12,21 @@ jobs: name: NPH runs-on: ubuntu-latest steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base - - name: Lint style + - name: Setup NPH # Pin nph to a specific version to avoid sudden style differences. - # Updating nph version should be accompanied with running the new - # version on the fluffy directory. + # Updating nph version should be accompanied with running the new version on the fluffy directory. run: | VERSION="v0.5.1" ARCHIVE="nph-linux_x64.tar.gz" curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} tar -xzf ${ARCHIVE} + + - name: Check style + run: | shopt -s extglob # Enable extended globbing - ./nph examples libp2p tests tools *.@(nim|nims|nimble) - git diff --exit-code + ./nph --check examples libp2p tests tools *.@(nim|nims|nimble) From 18396f511bf3deb1686a18d07dc1f5c68bba6d83 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 13:12:31 +0200 Subject: [PATCH 60/70] wip --- .github/workflows/continuous_integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 8582c41619..80f8f7d203 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -13,7 +13,6 @@ concurrency: jobs: test: - needs: delete_cache timeout-minutes: 90 strategy: fail-fast: false From 31278c7737294261f4eb9bcdd38298734150fe66 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 15:06:07 +0200 Subject: [PATCH 61/70] wip --- .github/workflows/daily_amd64.yml | 1 + .github/workflows/daily_devel.yml | 1 + .github/workflows/daily_i386.yml | 1 + .github/workflows/dependencies.yml | 1 + .github/workflows/documentation.yml | 1 + .github/workflows/interop.yml | 1 + 6 files changed, 6 insertions(+) diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index b10c461cfd..be2373ec5a 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -1,4 +1,5 @@ name: Daily amd64 + on: schedule: - cron: "30 6 * * *" diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 182bee9d81..7ee8ef31fb 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -1,4 +1,5 @@ name: Daily Nim Devel + on: schedule: - cron: "30 6 * * *" diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 990c077d50..2ea2dfff0b 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -1,4 +1,5 @@ name: Daily i386 + on: schedule: - cron: "30 6 * * *" diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 5008e210a2..022622a937 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -1,4 +1,5 @@ name: Update libp2p's version where it serves as a dependency + on: push: branches: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 530045a8a8..f31d7c45ec 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,5 @@ name: Documentation generation and publishing + on: push: branches: diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index c9a6853626..0998fbbb9b 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -1,4 +1,5 @@ name: Interoperability Tests + on: pull_request: push: From c03f4e5c7dcc70db87d7affb9b66a940ee688a9b Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 17:25:55 +0200 Subject: [PATCH 62/70] wip --- .github/workflows/{continuous_integration.yml => ci.yml} | 0 .github/workflows/daily_amd64.yml | 1 - .github/workflows/daily_devel.yml | 1 - .github/workflows/daily_i386.yml | 1 - 4 files changed, 3 deletions(-) rename .github/workflows/{continuous_integration.yml => ci.yml} (100%) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/continuous_integration.yml rename to .github/workflows/ci.yml diff --git a/.github/workflows/daily_amd64.yml b/.github/workflows/daily_amd64.yml index be2373ec5a..a4031d7680 100644 --- a/.github/workflows/daily_amd64.yml +++ b/.github/workflows/daily_amd64.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "30 6 * * *" workflow_dispatch: - pull_request: jobs: test_amd64: diff --git a/.github/workflows/daily_devel.yml b/.github/workflows/daily_devel.yml index 7ee8ef31fb..391494036f 100644 --- a/.github/workflows/daily_devel.yml +++ b/.github/workflows/daily_devel.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "30 6 * * *" workflow_dispatch: - pull_request: jobs: test_nim_devel: diff --git a/.github/workflows/daily_i386.yml b/.github/workflows/daily_i386.yml index 2ea2dfff0b..649c37b807 100644 --- a/.github/workflows/daily_i386.yml +++ b/.github/workflows/daily_i386.yml @@ -4,7 +4,6 @@ on: schedule: - cron: "30 6 * * *" workflow_dispatch: - pull_request: jobs: test_i386: From 11bd9decdd0632b593851fb0d06b95b0b93935a1 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 18:14:31 +0200 Subject: [PATCH 63/70] wip --- .github/workflows/base_daily_tests.yml | 12 ++++++------ .github/workflows/ci.yml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 8256b2532a..0d6304248d 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - platform: + target: - os: linux builder: ubuntu-22.04 shell: bash @@ -50,10 +50,10 @@ jobs: defaults: run: - shell: ${{ matrix.platform.shell }} + shell: ${{ matrix.target.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' - runs-on: ${{ matrix.platform.builder }} + name: '${{ matrix.target.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' + runs-on: ${{ matrix.target.builder }} continue-on-error: ${{ matrix.nim.branch == 'devel' || matrix.nim.branch == 'version-2-0' }} steps: - name: Checkout @@ -62,8 +62,8 @@ jobs: - name: Setup Nim uses: "./.github/actions/install_nim" with: - os: ${{ matrix.platform.os }} - shell: ${{ matrix.platform.shell }} + os: ${{ matrix.target.os }} + shell: ${{ matrix.target.shell }} nim_branch: ${{ matrix.nim.branch }} cpu: ${{ matrix.cpu }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80f8f7d203..e318757936 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ on: branches: - master pull_request: - workflow_call: + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - platform: + target: - os: linux cpu: amd64 shell: bash @@ -36,15 +36,15 @@ jobs: - branch: version-2-0 memory_management: refc include: - - platform: + - target: os: linux builder: ubuntu-22.04 shell: bash - - platform: + - target: os: macos builder: macos-13 shell: bash - - platform: + - target: os: windows builder: windows-latest shell: msys2 {0} @@ -53,7 +53,7 @@ jobs: run: shell: ${{ matrix.shell }} - name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' + name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.nim.branch }})' runs-on: ${{ matrix.builder }} continue-on-error: ${{ matrix.nim.branch == 'version-2-0' || matrix.nim.branch == 'devel' }} steps: @@ -65,10 +65,10 @@ jobs: - name: Setup Nim uses: "./.github/actions/install_nim" with: - os: ${{ matrix.platform.os }} + os: ${{ matrix.target.os }} shell: ${{ matrix.shell }} nim_branch: ${{ matrix.nim.branch }} - cpu: ${{ matrix.platform.cpu }} + cpu: ${{ matrix.target.cpu }} - name: Setup Go uses: actions/setup-go@v5 From c712daf83a1a3bb611d99a560f424edc9d9f4b46 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 18:19:22 +0200 Subject: [PATCH 64/70] wip --- .github/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e318757936..ac85f18c4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: shell: bash - target: os: windows - builder: windows-latest + builder: windows-2022 shell: msys2 {0} defaults: @@ -55,7 +55,6 @@ jobs: name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.nim.branch }})' runs-on: ${{ matrix.builder }} - continue-on-error: ${{ matrix.nim.branch == 'version-2-0' || matrix.nim.branch == 'devel' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -66,23 +65,30 @@ jobs: uses: "./.github/actions/install_nim" with: os: ${{ matrix.target.os }} + cpu: ${{ matrix.target.cpu }} shell: ${{ matrix.shell }} nim_branch: ${{ matrix.nim.branch }} - cpu: ${{ matrix.target.cpu }} - name: Setup Go uses: actions/setup-go@v5 with: go-version: '~1.15.5' - cache: false - name: Install p2pd run: | V=1 bash scripts/build_p2pd.sh p2pdCache 124530a3 - + + - name: Restore deps from cache + id: deps-cache + uses: actions/cache@v3 + with: + path: nimbledeps + key: nimbledeps-${{ hashFiles('.pinned') }} + - name: Install deps + if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} run: | - nimble install -y --depsOnly + nimble install_pinned - name: Run tests run: | From 6f6a121a6d8d2be78348573348b3686798816cee Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 18:22:21 +0200 Subject: [PATCH 65/70] wip --- .github/workflows/base_daily_tests.yml | 12 ++++++------ .github/workflows/ci.yml | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/base_daily_tests.yml index 0d6304248d..8256b2532a 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/base_daily_tests.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - target: + platform: - os: linux builder: ubuntu-22.04 shell: bash @@ -50,10 +50,10 @@ jobs: defaults: run: - shell: ${{ matrix.target.shell }} + shell: ${{ matrix.platform.shell }} - name: '${{ matrix.target.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' - runs-on: ${{ matrix.target.builder }} + name: '${{ matrix.platform.os }}-${{ matrix.cpu }} (Nim ${{ matrix.nim.branch }})' + runs-on: ${{ matrix.platform.builder }} continue-on-error: ${{ matrix.nim.branch == 'devel' || matrix.nim.branch == 'version-2-0' }} steps: - name: Checkout @@ -62,8 +62,8 @@ jobs: - name: Setup Nim uses: "./.github/actions/install_nim" with: - os: ${{ matrix.target.os }} - shell: ${{ matrix.target.shell }} + os: ${{ matrix.platform.os }} + shell: ${{ matrix.platform.shell }} nim_branch: ${{ matrix.nim.branch }} cpu: ${{ matrix.cpu }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac85f18c4b..0498da97ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - target: + platform: - os: linux cpu: amd64 shell: bash @@ -36,15 +36,15 @@ jobs: - branch: version-2-0 memory_management: refc include: - - target: + - platform: os: linux builder: ubuntu-22.04 shell: bash - - target: + - platform: os: macos builder: macos-13 shell: bash - - target: + - platform: os: windows builder: windows-2022 shell: msys2 {0} @@ -53,7 +53,7 @@ jobs: run: shell: ${{ matrix.shell }} - name: '${{ matrix.target.os }}-${{ matrix.target.cpu }} (Nim ${{ matrix.nim.branch }})' + name: '${{ matrix.platform.os }}-${{ matrix.platform.cpu }} (Nim ${{ matrix.nim.branch }})' runs-on: ${{ matrix.builder }} steps: - name: Checkout @@ -64,8 +64,8 @@ jobs: - name: Setup Nim uses: "./.github/actions/install_nim" with: - os: ${{ matrix.target.os }} - cpu: ${{ matrix.target.cpu }} + os: ${{ matrix.platform.os }} + cpu: ${{ matrix.platform.cpu }} shell: ${{ matrix.shell }} nim_branch: ${{ matrix.nim.branch }} From ad3eb64774ad6b638fe68af5a95ead040ec2d561 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 19:13:34 +0200 Subject: [PATCH 66/70] wip --- .github/workflows/ci.yml | 4 ---- .github/workflows/coverage.yml | 8 ++++---- .github/workflows/dependencies.yml | 16 +++++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0498da97ff..c52807307b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,16 +20,12 @@ jobs: platform: - os: linux cpu: amd64 - shell: bash - os: linux cpu: i386 - shell: bash - os: macos cpu: amd64 - shell: bash - os: windows cpu: amd64 - shell: msys2 {0} nim: - branch: version-1-6 memory_management: refc diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b06013cdfa..062ed8fbcc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,7 @@ name: Coverage on: - # On push to common branches, this computes the coverage PRs will compared against + # On push to common branches, this computes the coverage that PRs will use for diff push: branches: - master @@ -41,7 +41,7 @@ jobs: if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} run: | nimble install_pinned - + - name: Setup coverage run: | sudo apt-get update @@ -54,7 +54,7 @@ jobs: nimble testnative nimble testpubsub nimble testfilter - + - name: Run coverage run: | find nimcache -name *.c -delete @@ -63,7 +63,7 @@ jobs: ls `pwd`/libp2p/{*,**/*}.nim lcov --extract coverage/coverage.info `pwd`/libp2p/{*,**/*}.nim --output-file coverage/coverage.f.info genhtml coverage/coverage.f.info --output-directory coverage/output - + - name: Upload coverage to codecov run: | bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports" diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 022622a937..2baddfe9a0 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -8,17 +8,19 @@ on: jobs: update_version: - # Pushes new refs to interested external repositories, so they can do early testing against them. + # Pushes new refs to interested external repositories, so they can do early testing against libp2p's newer versions runs-on: ubuntu-latest name: Update libp2p's version for ${{ matrix.target.repository }}:${{ matrix.target.ref }} strategy: fail-fast: false matrix: - target: [ - { repository: status-im/nimbus-eth2, ref: unstable }, - { repository: waku-org/nwaku, ref: master }, - { repository: codex-storage/nim-codex, ref: master } - ] + target: + - repository: status-im/nimbus-eth2 + ref: unstable + - repository: waku-org/nwaku + ref: master + - repository: codex-storage/nim-codex + ref: master steps: - name: Clone target repository uses: actions/checkout@v4 @@ -27,7 +29,7 @@ jobs: ref: ${{ matrix.target.ref}} path: nbc fetch-depth: 0 - token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} + token: ${{ secrets.ACTIONS_GITHUB_TOKEN }} - name: Checkout this ref in target repository run: | From 2a1d38ea969e1062453e8b436f46d9bf83e9f59f Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Tue, 23 Jul 2024 18:19:49 +0200 Subject: [PATCH 67/70] wip --- .github/workflows/dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 2baddfe9a0..00d97be9bf 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -1,4 +1,4 @@ -name: Update libp2p's version where it serves as a dependency +name: Dependencies on: push: @@ -7,10 +7,10 @@ on: workflow_dispatch: jobs: - update_version: + bumper: # Pushes new refs to interested external repositories, so they can do early testing against libp2p's newer versions runs-on: ubuntu-latest - name: Update libp2p's version for ${{ matrix.target.repository }}:${{ matrix.target.ref }} + name: Bump libp2p's version for ${{ matrix.target.repository }}:${{ matrix.target.ref }} strategy: fail-fast: false matrix: From c5a36321dbb8895babcc25ddcb65575e2c22a488 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 26 Jul 2024 16:33:56 +0200 Subject: [PATCH 68/70] wip --- .github/workflows/{base_daily_tests.yml => daily_common.yml} | 3 ++- .github/workflows/documentation.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename .github/workflows/{base_daily_tests.yml => daily_common.yml} (96%) diff --git a/.github/workflows/base_daily_tests.yml b/.github/workflows/daily_common.yml similarity index 96% rename from .github/workflows/base_daily_tests.yml rename to .github/workflows/daily_common.yml index 8256b2532a..0b2e0d6197 100644 --- a/.github/workflows/base_daily_tests.yml +++ b/.github/workflows/daily_common.yml @@ -1,4 +1,5 @@ -name: Base Daily Tests +name: Daily Common +# Serves as base workflow for daily tasks, it's not run by itself. on: workflow_call: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f31d7c45ec..fd4525509b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,4 @@ -name: Documentation generation and publishing +name: Documentation Generation And Publishing on: push: From e9b3d248b1327ae1a2868710c5004249ed709ce0 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 2 Aug 2024 13:24:09 +0200 Subject: [PATCH 69/70] Fix wrong keys. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bffe12ca13..8d64f2630c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: os: linux-gcc-14 builder: ubuntu-24.04 shell: bash - - target: + - platform: os: macos builder: macos-13 shell: bash @@ -95,7 +95,7 @@ jobs: nimble install_pinned - name: Use gcc 14 - if : ${{ matrix.target.os == 'linux-gcc-14'}} + if : ${{ matrix.platform.os == 'linux-gcc-14'}} run: | # Add GCC-14 to alternatives sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14 From fd32a752471b0d9e69bfa5e1cb8a6a49f7860d76 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Fri, 2 Aug 2024 14:47:54 +0200 Subject: [PATCH 70/70] wip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d64f2630c..fcc8ed1cf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: include: - platform: os: linux - builder: ubuntu-24.04 + builder: ubuntu-22.04 shell: bash - platform: os: linux-gcc-14