-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'gitlab/master' into main
- Loading branch information
Showing
5 changed files
with
138 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,52 @@ | ||
variables: | ||
GIT_BRANCH: "${CI_COMMIT_REF_SLUG}" | ||
GIT_SUBMODULE_STRATEGY: recursive | ||
|
||
stages: | ||
- lint | ||
- test | ||
- sync-from-github | ||
- sync-to-github | ||
|
||
lint: | ||
image: golangci/golangci-lint:v1.42.1 | ||
stage: lint | ||
sync_from_github_job: | ||
stage: sync-from-github | ||
before_script: | ||
- apk add --no-cache git openssh-client | ||
- mkdir -p ~/.ssh | ||
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' > ~/.ssh/id_rsa | ||
- chmod 600 ~/.ssh/id_rsa | ||
- ssh-keyscan gitlab.snapp.ir >> ~/.ssh/known_hosts | ||
- ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
script: | ||
- golangci-lint run ./... | ||
- echo "Starting sync-from-github job" | ||
- git config --global user.email "platform@snapp.cab" | ||
- git config --global user.name "Platform" | ||
- git clone git@github.com:snapp-incubator/smapp-sdk-go.git | ||
- cd smapp-sdk-go | ||
- git remote add gitlab git@gitlab.snapp.ir:Map/sdk/smapp-sdk-go.git | ||
- git fetch origin main | ||
- git fetch gitlab $GIT_BRANCH | ||
- git merge gitlab/$GIT_BRANCH | ||
- git push gitlab HEAD:$GIT_BRANCH | ||
only: | ||
refs: | ||
- master | ||
allow_failure: false | ||
- schedules | ||
|
||
test: | ||
image: golang:1.17 | ||
sync_to_github_job: | ||
stage: sync-to-github | ||
before_script: | ||
- apk add --no-cache git openssh-client | ||
- mkdir -p ~/.ssh | ||
- echo "${SSH_PRIVATE_KEY}" | tr -d '\r' > ~/.ssh/id_rsa | ||
- chmod 600 ~/.ssh/id_rsa | ||
- ssh-keyscan gitlab.snapp.ir >> ~/.ssh/known_hosts | ||
- ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
script: | ||
- export GOPROXY=https://repo.snapp.tech/repository/goproxy/ | ||
- export GO111MODULE=on | ||
- go mod download | ||
- go test -race $(go list ./... | grep -v /vendor/) -v -coverprofile=coverage.out && grep -v "mock.go" coverage.out > cover.out | ||
- go tool cover -func=cover.out | ||
|
||
only: | ||
refs: | ||
- pushes | ||
allow_failure: false | ||
- echo "Starting sync-to-github job" | ||
- git config --global user.email "platform@snapp.cab" | ||
- git config --global user.name "Platform" | ||
- git clone git@github.com:snapp-incubator/smapp-sdk-go.git | ||
- cd smapp-sdk-go | ||
- git remote add gitlab git@gitlab.snapp.ir:Map/sdk/smapp-sdk-go.git | ||
- git fetch origin main | ||
- git fetch gitlab $GIT_BRANCH | ||
- git merge gitlab/$GIT_BRANCH | ||
- git push origin HEAD:main | ||
when: manual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
module github.com/snapp-incubator/smapp-sdk-go | ||
|
||
go 1.17 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/golang/mock v1.6.0 | ||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.27.0 | ||
go.opentelemetry.io/otel v1.2.0 | ||
go.opentelemetry.io/otel/trace v1.2.0 | ||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 | ||
go.opentelemetry.io/otel v1.29.0 | ||
go.opentelemetry.io/otel/trace v1.29.0 | ||
) | ||
|
||
require ( | ||
github.com/felixge/httpsnoop v1.0.2 // indirect | ||
go.opentelemetry.io/otel/internal/metric v0.25.0 // indirect | ||
go.opentelemetry.io/otel/metric v0.25.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 | ||
go.opentelemetry.io/otel/metric v1.29.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters