Skip to content

Commit

Permalink
Removing code from CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Oct 6, 2023
1 parent 6d0bc1d commit f96ff3c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 26 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@ jobs:
env:
GRAFANA_INTEGRATION: 1

services:
minio:
image: bitnami/minio:latest
ports:
- 9000:9000
- 9001:9001
options: >-
-e GF_AUTH_ANONYMOUS_ENABLED=true -e MINIO_ROOT_USER="test" -e MINIO_ROOT_PASSWORD="secretsss"
grafana:
# Docker Hub image
image: "grafana/grafana:${{ matrix.grafana }}"
ports:
- 3000:3000
options: >-
-e GF_AUTH_ANONYMOUS_ENABLED=true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -51,8 +35,6 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Wait for Minio to come up.
run: nc -z -v -w15 127.0.0.1 9000
- name: Calc coverage
if: "${{ matrix.go == '1.21.0' && matrix.grafana == '9.4.3' }}"
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run Gosec Security Scanner
uses: securego/gosec@master
uses: securego/gosec@v2.17.0
with:
args: --exclude=G402,G304 ./...
12 changes: 8 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ tasks:
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- go install github.com/client9/misspell/cmd/misspell@latest
- go install github.com/securego/gosec/v2/cmd/[email protected]
format:
desc: "Format code"
cmds:
- gofmt -w -s .
security:
desc: "Run security scan"
cmds:
- gosec --exclude=G402,G304 ./...
lint:
desc: "Lint project, skipping test files."
cmds:
Expand Down Expand Up @@ -62,10 +67,6 @@ tasks:
- go install -ldflags "{{ .LD_FLAGS}}"
- mv ${GOPATH}/bin/gdg ${GOPATH}/bin/{{ .BIN_NAME }}
silent: false
test:
desc: "Dos tuff"
cmds:
- echo ${GOPATH}
get-deps:
desc: "Tidy Deps"
cmds:
Expand Down Expand Up @@ -106,3 +107,6 @@ tasks:
desc: ""
cmds:
- go test -v ./... -cover
env:
GRAFANA_INTEGRATION: "1"

2 changes: 1 addition & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func DuplicateConfig(t *testing.T) string {
assert.Nil(t, err, "Failed to read test configuration file")
destination := os.TempDir()
cfgFile := fmt.Sprintf("%s/config.yml", destination)
err = os.WriteFile(cfgFile, data, 0644)
err = os.WriteFile(cfgFile, data, 0600)
assert.Nil(t, err, "Failed to save configuration file")

return cfgFile
Expand Down
2 changes: 1 addition & 1 deletion test/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func setupGrafanaContainer(pool *dockertest.Pool, wg *sync.WaitGroup) {
// pulls an image, creates a container based on it and runs it
defer wg.Done()
resource, err := pool.Run("grafana/grafana", "10.0.0-ubuntu",
[]string{"GF_INSTALL_PLUGINS=grafana-googlesheets-datasource"})
[]string{"GF_INSTALL_PLUGINS=grafana-googlesheets-datasource", "GF_AUTH_ANONYMOUS_ENABLED=true"})
if err != nil {
log.Fatalf("Could not start resource: %s", err)
}
Expand Down

0 comments on commit f96ff3c

Please sign in to comment.