Skip to content

Commit

Permalink
upgaded deps, bump to 1.22, testcontainers, github actions, fixed rac…
Browse files Browse the repository at this point in the history
…e cond in tests
  • Loading branch information
kopaygorodsky committed Jul 12, 2024
1 parent 051e018 commit 7fcda95
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 324 deletions.
67 changes: 0 additions & 67 deletions .circleci/config.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.22.5

- name: Install Dependencies
run: |
make mod-download
make tools
- name: Lint
run: golangci-lint run -v

- name: Check dependencies for vulnerabilities
run: make check-mods || true

- name: Run tests
run: |
make unit-test
make integration-test
- name: Upload reports to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

- name: Store test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: /tmp/test-reports
29 changes: 4 additions & 25 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,11 @@

# options for analysis running
run:
go: 1.22.5
# include test files or not, default is true
tests: true
timeout: 5m

# which dirs to skip: issues from them won't be reported;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but default dirs are skipped independently
# from this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work
# on Windows.
skip-dirs:
- pkg/kubernetes/fabric
- testing/mocks

# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true

# Allow multiple parallel golangci-lint instances running.
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: false
Expand All @@ -30,18 +17,14 @@ run:

linters:
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- unused
- varcheck
- goimports
- typecheck
#- errorlint
- gofmt
- misspell
- nestif
Expand All @@ -51,21 +34,17 @@ linters:

#em, not sure it's needed for every lint though... I'll check it later :)
linters-settings:
gosimple:
go: "1.16"
staticcheck:
go: "1.16"
unused:
go: "1.16"
gosec:
# Available rules: https://github.com/securego/gosec#available-rules
excludes:
- G404
nestif:
min-complexity: 8


issues:
exclude-dirs:
- pkg/kubernetes/fabric
- testing/mocks
max-same-issues: 0
max-issues-per-linter: 0
# Excluding configuration per-path, per-linter, per-text and per-source
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tools:
go install github.com/sonatype-nexus-community/nancy@latest
go install github.com/golang/mock/[email protected]
## using wget because go get is not working for 1.40.1
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | BINDIR=${GOPATH}/bin sh -s v1.46.2
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1

.PHONY: docker-start
docker-start:
Expand Down Expand Up @@ -75,7 +75,7 @@ lint:

.PHONY: lint-report
lint-report:
golangci-lintgolangci-lint run -v --issues-exit-code=0 --out-format checkstyle > lint-report.xml
golangci-lint run -v --issues-exit-code=0 --out-format checkstyle > lint-report.xml

.PHONY: create_reports_dir
create_reports_dir:
Expand Down
78 changes: 70 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,77 @@
module github.com/go-foreman/foreman

go 1.16
go 1.22.5

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
github.com/go-sql-driver/mysql v1.6.0
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/go-sql-driver/mysql v1.8.1
github.com/golang/mock v1.6.0
github.com/google/uuid v1.1.2
github.com/jackc/pgx/v4 v4.16.1
github.com/mitchellh/mapstructure v1.4.1
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v5 v5.6.0
github.com/mitchellh/mapstructure v1.5.0
github.com/pkg/errors v0.9.1
github.com/rabbitmq/amqp091-go v1.3.4
github.com/stretchr/testify v1.7.0
github.com/rabbitmq/amqp091-go v1.10.0
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go/modules/mysql v0.32.0
)

require (
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/Microsoft/hcsshim v0.12.4 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/containerd/containerd v1.7.19 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.0.3+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/testcontainers/testcontainers-go v0.32.0 // indirect
github.com/testcontainers/testcontainers-go/modules/postgres v0.32.0 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.28.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240711142825-46eb208f015d // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 7fcda95

Please sign in to comment.