Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCabeza committed Aug 1, 2024
1 parent da187bd commit b215d0c
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 384 deletions.
82 changes: 41 additions & 41 deletions .github/workflows/bumper.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: Bumper
on:
push:
branches:
- master
workflow_dispatch:
# name: Bumper
# on:
# push:
# branches:
# - master
# workflow_dispatch:

jobs:
bumpProjects:
runs-on: ubuntu-latest
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 }
]
steps:
- name: Clone repo
uses: actions/checkout@v2
with:
repository: ${{ matrix.target.repo }}
ref: ${{ matrix.target.branch }}
path: nbc
fetch-depth: 0
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
# jobs:
# bumpProjects:
# runs-on: ubuntu-latest
# 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 }
# ]
# steps:
# - name: Clone repo
# uses: actions/checkout@v2
# with:
# repository: ${{ matrix.target.repo }}
# ref: ${{ matrix.target.branch }}
# path: nbc
# fetch-depth: 0
# token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}

- name: Checkout this ref
run: |
cd nbc
git submodule update --init vendor/nim-libp2p
cd vendor/nim-libp2p
git checkout $GITHUB_SHA
# - name: Checkout this ref
# run: |
# cd nbc
# git submodule update --init vendor/nim-libp2p
# cd vendor/nim-libp2p
# git checkout $GITHUB_SHA

- name: Commit this bump
run: |
cd nbc
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name = "${{ github.actor }}"
git commit --allow-empty -a -m "auto-bump nim-libp2p"
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##*/}
# - name: Commit this bump
# run: |
# cd nbc
# git config --global user.email "${{ github.actor }}@users.noreply.github.com"
# git config --global user.name = "${{ github.actor }}"
# git commit --allow-empty -a -m "auto-bump nim-libp2p"
# 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##*/}
86 changes: 54 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ jobs:
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: |
nimble install_pinned
- name: Pre Debug Info
run: |
ls -la nimbledeps || echo ""
ls -la nimbledeps/pkgs || echo ""
ls -la nimbledeps/pkgs2 || echo ""
- name: Use gcc 14
if : ${{ matrix.target.os == 'ubuntu-24-gcc-14'}}
Expand All @@ -104,41 +98,69 @@ jobs:
# Set GCC-14 as the default
sudo update-alternatives --set gcc /usr/bin/gcc-14
- name: Run tests
env:
CC: gcc-11
CXX: g++-11
- name: Pre Debug Info
run: |
which nim
nim --version
which nimble
nimble --version
gcc --version
echo ""
echo ""
echo ""
ls -la nimbledeps || echo ""
ls -la nimbledeps/pkgs || echo ""
ls -la nimbledeps/pkgs2 || echo ""
echo ""
echo ""
echo ""
ls -la ~/.nimble || echo ""
ls -la ~/.nimble/pkgs || echo ""
ls -la ~/.nimble/pkgs2 || echo ""
- name: Run tests
run: |
nimble test
- name: Post Debug Info
- name: Pre Debug Info
run: |
which nim
nim --version
which nimble
nimble --version
gcc --version
echo ""
echo ""
echo ""
ls -la nimbledeps || echo ""
ls -la nimbledeps/pkgs || echo ""
ls -la nimbledeps/pkgs2 || echo ""
echo ""
echo ""
echo ""
ls -la ~/.nimble || echo ""
ls -la ~/.nimble/pkgs || echo ""
ls -la ~/.nimble/pkgs2 || echo ""
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
112 changes: 56 additions & 56 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: nim-libp2p codecov builds
# name: nim-libp2p codecov builds

on:
#On push to common branches, this computes the "bases stats" for PRs
push:
branches:
- master
pull_request:
workflow_dispatch:
# on:
# #On push to common branches, this computes the "bases stats" for PRs
# push:
# branches:
# - master
# pull_request:
# workflow_dispatch:

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:
Coverage:
runs-on: ubuntu-22.04
env:
CICOV: YES
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# jobs:
# Coverage:
# runs-on: ubuntu-22.04
# env:
# CICOV: YES
# steps:
# - uses: actions/checkout@v2
# 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@v3
with:
path: nimbledeps
key: nimbledeps-${{ hashFiles('.pinned') }}
# - 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: Install deps
# if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
# run: |
# nimble install_pinned

- name: Run
run: |
sudo apt-get update
sudo apt-get install -y lcov build-essential git curl
mkdir coverage
export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage"
nimble testnative
nimble testpubsub
nimble testfilter
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
bash <(curl -s https://codecov.io/bash) -f coverage/coverage.f.info || echo "Codecov did not collect coverage reports"
# - name: Run
# run: |
# sudo apt-get update
# sudo apt-get install -y lcov build-essential git curl
# mkdir coverage
# export NIMFLAGS="--lineDir:on --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage"
# nimble testnative
# nimble testpubsub
# nimble testfilter
# 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
# 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
# #- uses: actions/upload-artifact@master
# # with:
# # name: coverage
# # path: coverage
22 changes: 11 additions & 11 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Daily
on:
schedule:
- cron: "30 6 * * *"
workflow_dispatch:
# name: Daily
# 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']"
cpu: "['amd64']"
# jobs:
# call-multi-nim-common:
# uses: ./.github/workflows/daily_common.yml
# with:
# nim-branch: "['version-1-6','version-2-0']"
# cpu: "['amd64']"
Loading

0 comments on commit b215d0c

Please sign in to comment.