Skip to content

build(deps): bump github.com/cometbft/cometbft from 0.38.10 to 0.38.13 in /content #450

build(deps): bump github.com/cometbft/cometbft from 0.38.10 to 0.38.13 in /content

build(deps): bump github.com/cometbft/cometbft from 0.38.10 to 0.38.13 in /content #450

Workflow file for this run

name: Test
# **What it does**: Runs unit and integration tests when go files
# have been modified and provides code coverage reports.
#
# **Why we have it**: Ensures the application is production ready.
#
# **What does it impact**: Application stability.
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
runs-on: ubuntu-latest
permissions:
pull-requests: read # for technote-space/get-diff-action to get git reference
strategy:
matrix:
module: ["admin", "content", "governor", "subject", "validator", "voucher"]
steps:
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
**/go.mod
**/go.sum
- uses: actions/setup-go@v5
with:
go-version: '1.22'
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- run: make test-admin
if: |
(env.GIT_DIFF && matrix.module == 'admin') ||
github.ref == 'refs/heads/main'
- run: make test-content
if: |
(env.GIT_DIFF && matrix.module == 'content') ||
github.ref == 'refs/heads/main'
- run: make test-governor
if: |
(env.GIT_DIFF && matrix.module == 'governor') ||
github.ref == 'refs/heads/main'
- run: make test-subject
if: |
(env.GIT_DIFF && matrix.module == 'subject') ||
github.ref == 'refs/heads/main'
- run: make test-validator
if: |
(env.GIT_DIFF && matrix.module == 'validator') ||
github.ref == 'refs/heads/main'
- run: make test-voucher
if: |
(env.GIT_DIFF && matrix.module == 'voucher') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-admin
path: coverage-admin.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'admin') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-content
path: coverage-content.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'content') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-governor
path: coverage-governor.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'governor') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-subject
path: coverage-subject.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'subject') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-validator
path: coverage-validator.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'validator') ||
github.ref == 'refs/heads/main'
- uses: actions/upload-artifact@v4
with:
name: coverage-voucher
path: coverage-voucher.out
overwrite: true
if: |
(env.GIT_DIFF && matrix.module == 'voucher') ||
github.ref == 'refs/heads/main'
coverage:
runs-on: ubuntu-latest
permissions:
pull-requests: read # for technote-space/get-diff-action to get git reference
needs: [unit]
steps:
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
**/**.go
**/go.mod
**/go.sum
- uses: actions/download-artifact@v4
with:
name: coverage-admin
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: actions/download-artifact@v4
with:
name: coverage-content
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: actions/download-artifact@v4
with:
name: coverage-governor
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: actions/download-artifact@v4
with:
name: coverage-subject
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: actions/download-artifact@v4
with:
name: coverage-validator
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: actions/download-artifact@v4
with:
name: coverage-voucher
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- run: make test-coverage
if: env.GIT_DIFF || github.ref == 'refs/heads/main'
- uses: codecov/codecov-action@v3
with:
file: coverage.txt
if: env.GIT_DIFF || github.ref == 'refs/heads/main'