Skip to content

Commit

Permalink
Add mockery workflow with porcelain check.
Browse files Browse the repository at this point in the history
  • Loading branch information
winder committed Jul 30, 2024
1 parent a68def1 commit 8cc3c79
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# All code generation should be run prior to pull request. Running it again should not produce a diff.
name: "Codegen Verifier"

on:
pull_request:
push:
branches:
- 'ccip-develop'

jobs:
codegen-verifier:
runs-on: ubuntu-20.04
strategy:
matrix:
go-version: ['1.21']
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Generate mocks
run: go generate ./...
- name: ensure no changes
run: [ -z git status --porcelain=v1 2>/dev/null ] || echo "Modified files detected"; exit 1
7 changes: 6 additions & 1 deletion execute/types/token_data_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import (
// TokenDataReader is an interface for reading extra token data from an async process.
// TODO: Build a token data reading process.
//
//go:generate mockery --quiet --name TokenDataReader --output ../../internal/mocks --case=underscore
//go:generate mockery --name TokenDataReader --output ../../internal/mocks --case=underscore
type TokenDataReader interface {
ReadTokenData(ctx context.Context, srcChain cciptypes.ChainSelector, num cciptypes.SeqNum) ([][]byte, error)
}

//go:generate mockery --name TestInterface --output ../../internal/mocks --case=underscore
type TestInterface interface {
True() bool
}

0 comments on commit 8cc3c79

Please sign in to comment.