From 237654a90a9cb80eca4d25be28f00531e43121d8 Mon Sep 17 00:00:00 2001 From: Alejandro Cabeza Romero Date: Mon, 22 Jul 2024 13:07:47 +0200 Subject: [PATCH] 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)