Skip to content

Commit

Permalink
feat: solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ToniRamirezM committed Sep 17, 2024
2 parents 6e3a029 + 002612c commit 7129d46
Show file tree
Hide file tree
Showing 168 changed files with 6,499 additions and 2,405 deletions.
Binary file added .github/assets/cdk-logo-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions .github/assets/cdk-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 25 additions & 63 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ $default-branch, $protected-branches ]
branches:
- develop
- main
pull_request:
# The branches below must be a subset of the branches above
branches: [ $default-branch ]
schedule:
- cron: $cron-weekly

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
runs-on: ${{ matrix.language == 'swift' && 'macos-latest' || 'ubuntu-latest' }}
timeout-minutes: ${{ matrix.language == 'swift' && 120 || 360 }}
permissions:
actions: read
contents: read
Expand All @@ -38,45 +20,25 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ $detected-codeql-languages ]
# CodeQL supports [ $supported-codeql-languages ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
language:
- go

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint
on:
push:
branches:
- main
- develop
- update-external-dependencies
- 'release/**'
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
- name: Checkout code
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --timeout=30m
22 changes: 0 additions & 22 deletions .github/workflows/security-build.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
env:
Expand Down Expand Up @@ -57,8 +57,12 @@ jobs:
repository: 0xPolygon/kurtosis-cdk
path: "kurtosis-cdk"

- name: Setup Bats and bats libs
uses: bats-core/[email protected]

- name: Test
run: make test-e2e-${{ matrix.e2e-group }}
working-directory: test
env:
KURTOSIS_FOLDER: ${{ github.workspace }}/kurtosis-cdk
BATS_LIB_PATH: /usr/lib/
2 changes: 1 addition & 1 deletion .github/workflows/test-resequence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: logs_${{ github.run_id }}
path: ./kurtosis-cdk/ci_logs
40 changes: 40 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Unit and SonarCloud analysis

on:
push:
branches:
- main
- develop
- 'release/**'
pull_request:
workflow_dispatch: {}

jobs:
test-unit:
strategy:
fail-fast: false
matrix:
go-version: [1.22.4]
goarch: ["amd64"]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Test
run: make test-unit

- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/test-unittest.yml

This file was deleted.

67 changes: 36 additions & 31 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,78 @@
run:
timeout: 3m
tests: true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
skip-dirs:
- tests

service:
golangci-lint-version: 1.59.1

golangci-lint-version: 1.61.0
linters:
disable-all: true
enable:
- whitespace # Tool for detection of leading and trailing whitespace
# - wsl # Forces you to use empty lines
- wastedassign # Finds wasted assignment statements
- unconvert # Unnecessary type conversions
- unconvert # Unnecessary type conversions
- tparallel # Detects inappropriate usage of t.Parallel() method in your Go test codes
- thelper # Detects golang test helpers without t.Helper() call and checks the consistency of test helpers
# - stylecheck # Stylecheck is a replacement for golint
# - prealloc # Finds slice declarations that could potentially be pre-allocated
- stylecheck # Stylecheck is a replacement for golint
- prealloc # Finds slice declarations that could potentially be pre-allocated
- predeclared # Finds code that shadows one of Go's predeclared identifiers
# - nolintlint # Ill-formed or insufficient nolint directives
- nolintlint # Ill-formed or insufficient nolint directives
# - nlreturn # Checks for a new line before return and branch statements to increase code clarity
- misspell # Misspelled English words in comments
- makezero # Finds slice declarations with non-zero initial length
# - lll # Long lines
- importas # Enforces consistent import aliases
- lll # Long lines
- importas # Enforces consistent import aliases
- gosec # Security problems
- gofmt # Whether the code was gofmt-ed
- goimports # Unused imports
- goconst # Repeated strings that could be replaced by a constant
# - forcetypeassert # Finds forced type assertions
- forcetypeassert # Finds forced type assertions
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f())
# - dupl # Code clone detection
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error
# - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13
# - gocritic
- errcheck # Errcheck is a go lint rule for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
# - godox # Godox is a linter for TODOs and FIXMEs left in the code
- dupl # Code clone detection
- errname # Checks that sentinel errors are prefixed with Err and error types are suffixed with Error
- errorlint # Error wrapping introduced in Go 1.13
- gocritic # gocritic is a Go source code linter that maintains checks that are not in other linters
- errcheck # Errcheck is a go lint rule for checking for unchecked errors
# - godox # Linter for TODOs and FIXMEs left in the code
- gci # Gci checks the consistency of the code with the Go code style guide
- mnd # mnd is a linter for magic numbers
# - revive
- unparam # Unused function parameters

linters-settings:
gofmt:
simplify: true
goconst:
min-len: 3
min-occurrences: 3
gocritic:
enabled-checks:
- ruleguard
settings:
ruleguard:
rules: "./gorules/rules.go"
revive:
rules:
- name: exported
arguments:
- disableStutteringCheck
goconst:
min-len: 3
min-occurrences: 3
gosec:
excludes:
- G115 # Potential integer overflow when converting between integer types

issues:
new-from-rev: origin/develop # report only new issues with reference to develop branch
whole-files: true
exclude-rules:
- path: _test\.go
- path: '(_test\.go|^test/.*)'
linters:
- gosec
- unparam
- lll
- path: gen_sc_data\.go
- path: 'etherman/contracts/contracts_(banana|elderberry)\.go'
linters:
- wsl
- lll
- stylecheck
- dupl
exclude-dirs:
- tests
- aggregator/db/migrations
include:
- EXC0012 # Exported (.+) should have comment( \(or a comment on this block\))? or be unexported
- EXC0013 # Package comment should be of the form "(.+)...
Expand Down
Loading

0 comments on commit 7129d46

Please sign in to comment.