Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/v2-aggregator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Aggregator CI

on:
push:
paths:
- 'v2/aggregator/**'
pull_request:
paths:
- 'v2/aggregator/**'

defaults:
run:
working-directory: v2/aggregator

permissions:
contents: read

jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: v2/aggregator/go.mod

- name: Install just
uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d # v2.0.0

- name: Install protoc
run: |
PROTOC_VERSION="32.0"
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip"
sudo unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local bin/protoc
sudo unzip -o protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local 'include/*'
rm protoc-${PROTOC_VERSION}-linux-x86_64.zip
protoc --version

- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

- name: Install protoc-gen-go-grpc
run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

- name: Install buf
uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
with:
version: latest
working-directory: v2/aggregator
args: --help # Just install, don't run yet

- name: Run lint
run: just lint

- name: Run proto-check
run: just proto-check

- name: Run tests
run: just test
32 changes: 32 additions & 0 deletions .github/workflows/v2-devenv-tidy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Devenv Tidy
on:
push:

defaults:
run:
working-directory: v2/build/devenv

permissions:
contents: read

jobs:
devenv-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Go with module caching
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: v2/build/devenv/go.mod
- name: Verify go.mod and go.sum
run: |
go mod tidy
if ! git diff --exit-code -- go.mod go.sum; then
echo "❌ go.mod or go.sum has uncommitted changes after go mod tidy"
echo "Please run: go mod tidy"
git diff -- go.mod go.sum
exit 1
fi
71 changes: 71 additions & 0 deletions .github/workflows/v2-e2e-evm-testnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: End-to-end CCV Test (EVM Testnets)

on:
workflow_dispatch:

defaults:
run:
working-directory: build/devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
e2e:
permissions:
id-token: write
contents: read
runs-on: ubuntu24.04-16cores-64GB

Check failure on line 19 in .github/workflows/v2-e2e-evm-testnet.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This Ubuntu runner is 4-8 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / error)
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'
- name: Build Docker images with Just
run: just build-docker-dev-ci
env:
DOCKER_BUILDKIT: 1
- name: List built images
run: docker images
- name: Set up Go with module caching
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: build/devenv/go.mod
cache: true
- name: Cache Go modules
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4

Check failure on line 43 in .github/workflows/v2-e2e-evm-testnet.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This version (0400d5f644dc74513175e3cd8d07132dd4860809) of actions/cache is being deprecated. Please update to v4. (actions-cache / error)
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: |
go mod download
- name: Run CCV environment
env:
ETH_FUJI_PRIVATE_KEY: ${{ secrets.ETH_FUJI_PRIVATE_KEY }}
run: |
case "${{ inputs.network }}" in
eth_fuji)
PRIVATE_KEY=$ETH_FUJI_PRIVATE_KEY
;;
*)
echo "Unknown network: ${{ inputs.network }}"
exit 1
;;
esac
cd cmd/ccv && go install . && cd -
PRIVATE_KEY=${PRIVATE_KEY} ccv env.toml,env-fuji-fantom.toml
- name: Run Soak Test
working-directory: build/devenv/tests/e2e
run: go test -timeout 2h -v -run TestSoak
67 changes: 67 additions & 0 deletions .github/workflows/v2-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: End-to-end CCV Test

on:
push:

defaults:
run:
working-directory: v2/build/devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
e2e:
permissions:
id-token: write
contents: read
runs-on: ubuntu24.04-16cores-64GB

Check failure on line 19 in .github/workflows/v2-e2e.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This Ubuntu runner is 4-8 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / error)
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
aws-region: us-east-1
- name: Authenticate to ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
with:
registry-type: public
- name: Build Docker images with Just
run: just build-docker-dev-ci
env:
DOCKER_BUILDKIT: 1
- name: List built images
run: docker images
- name: Set up Go with module caching
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: v2/build/devenv/go.mod
cache: true
- name: Cache Go modules
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4

Check failure on line 53 in .github/workflows/v2-e2e.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This version (0400d5f644dc74513175e3cd8d07132dd4860809) of actions/cache is being deprecated. Please update to v4. (actions-cache / error)
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: |
go mod download
- name: Run CCV environment
run: |
cd cmd/ccv && go install . && cd -
ccv u env.toml
66 changes: 66 additions & 0 deletions .github/workflows/v2-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Services CCV Tests

on:
push:

defaults:
run:
working-directory: build/devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
e2e:
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
aws-region: us-east-1
- name: Authenticate to ECR Public
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
with:
registry-type: public
- name: Build Docker images with Just
run: just build-docker-dev-ci
env:
DOCKER_BUILDKIT: 1
- name: List built images
run: docker images
- name: Set up Go with module caching
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version-file: build/devenv/go.mod
cache: true
- name: Cache Go modules
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4

Check failure on line 53 in .github/workflows/v2-services.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This version (0400d5f644dc74513175e3cd8d07132dd4860809) of actions/cache is being deprecated. Please update to v4. (actions-cache / error)
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go dependencies
run: |
go mod download
- name: Run CCV environment
run: |
go test -v -run TestService ./...
36 changes: 36 additions & 0 deletions v2/Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Detect the system architecture
ARCH := `uname -m`

# Find 'protoc' download URL based on the architecture
PROTOC_ZIP := if ARCH == 'x86_64' {
"protoc-32.0-linux-x86_64.zip"
} else if ARCH == 'arm64' {
"protoc-32.0-osx-aarch_64.zip"
} else {
error("Unsupported architecture: " + ARCH)
}
PROTOC_URL := "https://github.com/protocolbuffers/protobuf/releases/download/v32.0/"+PROTOC_ZIP
PROTOC_BIN := env('PROTOC_BIN', '/usr/local/bin/protoc')

# Default: show available recipes
default:
just --list

# Run go mod tidy across all submodules
tidy:
gomods tidy

install-protoc:
@echo "Downloading and installing protoc for {{ARCH}}..."
curl -OL "{{PROTOC_URL}}"
sudo unzip -o "{{PROTOC_ZIP}}" -d /usr/local bin/protoc
sudo unzip -o "{{PROTOC_ZIP}}" -d /usr/local 'include/*'
rm -f "{{PROTOC_ZIP}}"
sudo chmod +x "{{PROTOC_BIN}}"
@echo "Installed protoc version:"
"{{PROTOC_BIN}}" --version
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.8
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1

proto:
@just ./aggregator/proto
14 changes: 14 additions & 0 deletions v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Chainlink CCV

## Getting started

Run all the services in local environment, install [Nix](https://github.com/DeterminateSystems/nix-installer) and run
```bash
nix develop
just clean-docker-dev # needed in case you have old JD image
just build-docker-dev
```
Then enter the `ccv` shell and run `up`
```bash
ccv sh
```
1 change: 1 addition & 0 deletions v2/aggregator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tmp/
Loading
Loading