Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroCabeza committed Oct 16, 2024
1 parent 0f74e7c commit ba5fb7c
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 113 deletions.
120 changes: 60 additions & 60 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
name: Coverage
# name: Coverage

on:
# On push to common branches, this computes the coverage that PRs will use for diff
push:
branches:
- master
pull_request:
merge_group:
workflow_dispatch:
# on:
# # On push to common branches, this computes the coverage that PRs will use for diff
# push:
# branches:
# - master
# pull_request:
# merge_group:
# 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:
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:
# 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: Setup coverage
run: |
sudo apt-get update
sudo apt-get install -y lcov build-essential git curl
mkdir coverage
# - name: Setup coverage
# run: |
# sudo apt-get update
# sudo apt-get install -y lcov build-essential git curl
# mkdir coverage

- 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
nimble testpubsub
nimble testfilter
# - 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
# 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"
104 changes: 52 additions & 52 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
name: Interoperability Tests
# name: Interoperability Tests

on:
pull_request:
merge_group:
push:
branches:
- master
workflow_dispatch:
# on:
# pull_request:
# merge_group:
# push:
# branches:
# - master
# 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:
run-transport-interop:
name: Run transport interoperability tests
runs-on: ubuntu-22.04
steps:
- name: Free Disk Space
# For some reason we have space issues while running this action. Likely while building the image.
# This action will free up some space to avoid the issue.
uses: jlumbroso/[email protected]
with:
tool-cache: true
# jobs:
# run-transport-interop:
# name: Run transport interoperability tests
# runs-on: ubuntu-22.04
# steps:
# - name: Free Disk Space
# # For some reason we have space issues while running this action. Likely while building the image.
# # This action will free up some space to avoid the issue.
# uses: jlumbroso/[email protected]
# with:
# tool-cache: true

- 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
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
# - 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
# s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
# s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
# s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}

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
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
# 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
# s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
# s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
# s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
# aws-region: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_REGION }}
1 change: 0 additions & 1 deletion .pinned
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ testutils;https://github.com/status-im/nim-testutils@#dfc4c1b39f9ded9baf6365014d
unittest2;https://github.com/status-im/nim-unittest2@#2300fa9924a76e6c96bc4ea79d043e3a0f27120c
websock;https://github.com/status-im/nim-websock@#f8ed9b40a5ff27ad02a3c237c4905b0924e3f982
zlib;https://github.com/status-im/nim-zlib@#38b72eda9d70067df4a953f56b5ed59630f2a17b
ngtcp2;https://github.com/status-im/nim-ngtcp2@#6834f4756b6af58356ac9c4fef3d71db3c3ae5fe

0 comments on commit ba5fb7c

Please sign in to comment.