Skip to content

Commit

Permalink
Add Codecov (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarof2 authored Apr 10, 2024
1 parent 61c43e2 commit 0c61e7e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/actions/upload-codecov/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Upload Codecov report"
description: "Fetches Codecov token and uploads report"
inputs:
report-name:
description: "Report name to use while uploading it"
required: false
default: ""
runs:
using: "composite"
steps:
- name: Akeyless Get CODECOV_TOKEN Secrets
id: get_codecov_token
uses: docker://us-west1-docker.pkg.dev/devopsre/akeyless-public/akeyless-action:latest
with:
api-url: https://api.gateway.akeyless.celo-networks-dev.org
access-id: p-kf9vjzruht6l
static-secrets: '{"/static-secrets/dev-tooling-circle/codecov/developer-tooling":"CODECOV_TOKEN"}'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
verbose: true
name: ${{ inputs.report-name }}
env:
CODECOV_TOKEN: ${{ env.CODECOV_TOKEN }}
34 changes: 30 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ jobs:
general_test:
name: General jest test
runs-on: ['self-hosted', 'org', '8-cpu']
permissions: # Must change the job token permissions to use Akeyless JWT auth
id-token: write
contents: read
needs: install-dependencies
steps:
- uses: actions/checkout@v4
Expand All @@ -160,16 +163,23 @@ jobs:
--exclude celo \
--exclude "@celo/{celocli,contractkit,wallet-*}" \
-ip \
run test
run test --coverage
- name: Upload Jest Test Results
uses: actions/upload-artifact@v3
with:
name: Jest Test Results
path: test-results/jest
- uses: ./.github/actions/upload-codecov
with:
report-name: "general_test"

wallet-test:
name: Wallet test
runs-on: ['self-hosted', 'org', '8-cpu']
timeout-minutes: 30
permissions: # Must change the job token permissions to use Akeyless JWT auth
id-token: write
contents: read
needs: install-dependencies
steps:
- uses: actions/checkout@v4
Expand All @@ -180,12 +190,19 @@ jobs:
- run: sudo corepack enable yarn
- name: Run Wallet tests
run: |
yarn workspaces foreach -ip --all --include '@celo/wallet-*' run test
yarn workspaces foreach -ip --all --include '@celo/wallet-*' run test --coverage
- uses: ./.github/actions/upload-codecov
with:
report-name: "wallet"


contractkit-tests:
name: ContractKit Tests
runs-on: ['self-hosted', 'org', '8-cpu']
timeout-minutes: 30
permissions: # Must change the job token permissions to use Akeyless JWT auth
id-token: write
contents: read
needs: [install-dependencies]
if: |
Expand All @@ -203,12 +220,18 @@ jobs:
- run: sudo corepack enable yarn
- name: Run tests
run: |
yarn workspace @celo/contractkit test
yarn workspace @celo/contractkit test --coverage
- uses: ./.github/actions/upload-codecov
with:
report-name: "contractkit"

cli-tests:
name: CeloCli Tests
runs-on: ['self-hosted', 'org', '8-cpu']
timeout-minutes: 30
permissions: # Must change the job token permissions to use Akeyless JWT auth
id-token: write
contents: read
needs: [install-dependencies]
if: |
Expand All @@ -227,13 +250,16 @@ jobs:
artifacts_to_cache: ${{ needs.install-dependencies.outputs.artifacts_to_cache }}
- name: Run tests
run: |
yarn workspace @celo/celocli test
yarn workspace @celo/celocli test --coverage
- name: Verify that a new account can be created
run: |
yarn workspace @celo/celocli run celocli account:new
- name: Test that releasecelo command topic is working
run: |
yarn workspace @celo/celocli run celocli releasecelo --help
- uses: ./.github/actions/upload-codecov
with:
report-name: "celocli"

docs-tests:
name: Docs tests
Expand Down

0 comments on commit 0c61e7e

Please sign in to comment.