Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swell (Testnet) #690

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into alt/swell-testnet
  • Loading branch information
atenjin committed Jan 31, 2025
commit 4c5599660aebdf06b35ee8f3798619965bcb5202
111 changes: 0 additions & 111 deletions .circleci/artifact_upload_config.yml

This file was deleted.

155 changes: 113 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,135 @@
version: 2.1

# This allows us to use CircleCI's dynamic configuration feature
setup: true

parameters:
chain:
type: string
default: "__required__"

orbs:
continuation: circleci/continuation@0.3.1
codecov: codecov/codecov@5.0.3

jobs:
generate-and-select-continuation-config:
go-lint-test:
parameters:
package:
type: string
docker:
- image: alpine:latest
- image: cimg/go:1.23.1
steps:
- checkout
- run:
name: Install Git, yq, and jq
name: Tidy mod
command: |
apk add --no-cache git jq curl
curl -sLo /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
chmod +x /usr/local/bin/yq
go mod tidy
git diff --exit-code
working_directory: << parameters.package >>
- run:
name: Verify Git
command: git --version
name: Lint
command: golangci-lint run ./...
working_directory: << parameters.package >>
- run:
name: Verify yq
command: yq --version
name: Run tests
command: gotestsum --format testname --junitfile test-results.xml --packages=./... -- --coverprofile coverage.out
working_directory: << parameters.package >>
- store_test_results:
path: << parameters.package >>/test-results.xml
- codecov/upload:
disable_search: true
files: ./<<parameters.package>>/coverage.out

run-tool:
parameters:
tool:
type: string
args:
type: string
default: ""
check_diff:
type: boolean
default: false
docker:
- image: cimg/go:1.23.1
steps:
- checkout
- run:
name: Verify jq
command: jq --version
name: Run tool
command: go run ./cmd/<< parameters.tool >>/main.go << parameters.args >>
working_directory: ops
- when:
condition: << parameters.check_diff >>
steps:
- run:
name: Check diff
command: git diff --exit-code

check-staging-empty:
docker:
- image: cimg/go:1.23.1
steps:
- checkout
- run:
name: Generate Configuration
name: Check staging is empty
command: |
if [[ $CIRCLE_BRANCH == pull/* ]]; then
is_forked_pull_request=true
else
is_forked_pull_request=false
fi
echo "{\"is_forked_pull_request\":$is_forked_pull_request}" > .circleci/parameters.json
# Count number of files in .staging (including hidden files)
file_count=$(ls -la .staging | wc -l)
# Subtract 3 from count to account for "." and ".." and ".gitkeep"
actual_count=$((file_count - 3))

if [ "<< pipeline.parameters.chain >>" = "__required__" ]; then
# This will always be selected unless the user chooses to interact with the configuration by setting a non default value in the chain parameter. This would happens if the user launch the pipeline with a specific chain value via either curl or the CircleCI GUI.
# Check if .gitkeep exists
if [ ! -f ".staging/.gitkeep" ]; then
echo "Error: .gitkeep file is missing"
exit 1
fi

echo "Generating test configuration..."
sh validation/genesis/validation-inputs/generate-test-config.sh
cp .circleci/main_config.yml .circleci/selected_continue_config.yml
else
# This only runs if launched with curl or the CircleCI GUI with non default chain value
# Nothing else should be in the directory
if [ $actual_count -ne 1 ]; then
echo "Staging directory is not empty"
exit 1
fi

echo "Generating interactive configuration..."
cp .circleci/artifact_upload_config.yml .circleci/selected_continue_config.yml
run-staging-report:
circleci_ip_ranges: true
docker:
- image: cimg/go:1.23.1
steps:
- checkout
- run:
name: Check if PR
command: |
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
echo "Not a PR, skipping"
circleci-agent step halt
fi
- continuation/continue:
configuration_path: .circleci/selected_continue_config.yml
parameters: .circleci/parameters.json
- run:
name: Run staging report
command: |
cd ops
go run ./cmd/print_staging_report/main.go

workflows:
setup:
main:
jobs:
- generate-and-select-continuation-config
- go-lint-test:
name: go-lint-test-ops
package: ops
- go-lint-test:
name: go-lint-test-validation
package: validation
- run-tool:
name: check-genesis-integrity
tool: check_genesis_integrity
- run-tool:
name: check-codegen
tool: codegen
check_diff: true
- run-tool:
name: check-staging-synced
tool: sync_staging
check_diff: true
- check-staging-empty:
name: check-staging-empty
- run-tool:
name: check-apply-hardforks
tool: apply_hardforks
check_diff: true
- run-tool:
name: check-chainlist
tool: check_chainlist
- run-staging-report:
name: run-staging-report

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.