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

Update actions #303

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 2 additions & 62 deletions .github/workflows/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
name: Workflow
on:
on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
code-check:
name: Check Go formatting, linting, vetting
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Run the formatter, linter, and vetter
uses: dell/common-github-actions/go-code-formatter-linter-vetter@main
with:
directories: ./...
sanitize:
name: Check for forbidden words
runs-on: ubuntu-latest
Expand All @@ -25,57 +15,7 @@ jobs:
uses: dell/common-github-actions/code-sanitizer@main
with:
args: /github/workspace
test:
name: Run Go unit tests and check package coverage
runs-on: ubuntu-latest
container: node:20
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Run unit tests and check package coverage
uses: dell/common-github-actions/go-code-tester@main
with:
threshold: 90
skip-list: "karavi-authorization/deploy,karavi-authorization/internal/web,karavi-authorization/internal/tenantsvc,karavi-authorization/cmd/karavictl/cmd,karavi-authorization/cmd/proxy-server,karavi-authorization/cmd/tenant-service,karavi-authorization/internal/proxy,karavi-authorization/internal/tenantsvc,karavi-authorization/internal/token/jwx,karavi-authorization/internal/k8s,karavi-authorization/internal/role-service,karavi-authorization/internal/role-service/validate,karavi-authorization/cmd/sidecar-proxy"
env:
# The hostname used to communicate with the Redis service container
REDIS_HOST: redis
# The default Redis port
REDIS_PORT: 6379

go_security_scan:
name: Go security
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Run Go Security
uses: securego/gosec@master
with:
args: -exclude=G108,G402,G307 ./...
malware_security_scan:
name: Malware Scanner
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Run malware scan
uses: dell/common-github-actions/malware-scanner@main
with:
directories: .
options: -ri
image_security_scan:
name: Image Scanner
runs-on: ubuntu-latest
Expand All @@ -90,7 +30,7 @@ jobs:
- name: Install Mockgen
run: go get github.com/golang/mock/[email protected]
- name: Get dependencies
run: go mod download
run: go mod download
- name: Build karavi-authorization Docker Images
run: make builder
- name: Get podman image tags for image scans
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/common-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Common Workflows
on: # yamllint disable-line rule:truthy
push:
branches: [main]
pull_request:
branches: ["**"]

env:
# The hostname used to communicate with the Redis service container
REDIS_HOST: redis
# The default Redis port
REDIS_PORT: 6379

jobs:

# golang static analysis checks
go-static-analysis:
uses: dell/common-github-actions/.github/workflows/go-static-analysis.yaml@main
name: Golang Validation

redis:
name: Set up Redis
runs-on: ubuntu-latest
container: node:20
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

common:
name: Quality Checks
needs: redis
uses: dell/common-github-actions/.github/workflows/go-common.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/go-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Reusable workflow to perform go version update on Golang based projects
name: Go Version Update

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
repository_dispatch:
types: [go-update-workflow]
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/linters.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/sidecar-proxy/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestProxyInstanceHandler(t *testing.T) {
rp := httputil.NewSingleHostReverseProxy(u)
rp.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
InsecureSkipVerify: true, // #nosec G402
},
}

Expand Down
Loading
Loading