Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
florindragos committed Dec 18, 2024
2 parents 5f6fda9 + 601ec3e commit 2e3b232
Show file tree
Hide file tree
Showing 31 changed files with 432 additions and 1,169 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: ci

on:
Expand All @@ -15,25 +16,25 @@ on:
env:
VAULT_ADDR: https://vault.eng.aserto.com/
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'main' || '' }}
GO_VERSION: "1.22"
GO_RELEASER_VERSION: "v1.24.0"
GO_LANGCI_LINT_VERSION: "v1.56.2"
GO_VERSION: "1.23"
GO_RELEASER_VERSION: "v2.3.2"
GO_LANGCI_LINT_VERSION: "v1.61.0"
GO_TESTSUM_VERSION: "1.11.0"

jobs:
test:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Build
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -42,29 +43,25 @@ jobs:
args: build --clean --snapshot --single-target
-
name: Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GO_LANGCI_LINT_VERSION }}
args: --timeout=30m
# -
# name: Test Setup
# uses: autero1/[email protected]
# with:
# gotestsum_version: ${{ env.GO_TESTSUM_VERSION }}
# -
# name: Test
# run: |
# gotestsum --format short-verbose -- -count=1 -parallel=1 -v -timeout=240s -coverprofile=cover.out -coverpkg=./... ./...

push:
runs-on: ubuntu-latest
# when on a branch only push if the branch is main
# always push when ref is a tag
if: github.event_name == 'push' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || startsWith(github.ref, 'refs/heads/dev-') || startsWith(github.ref, 'refs/tags/v') )
if: >
github.event_name == 'push' &&
( github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/heads/release-') ||
startsWith(github.ref, 'refs/heads/dev-') ||
startsWith(github.ref, 'refs/tags/v') )
steps:
-
name: Read Configuration
uses: hashicorp/vault-action@v2
uses: hashicorp/vault-action@v3
id: vault
with:
url: https://vault.eng.aserto.com/
Expand All @@ -76,19 +73,17 @@ jobs:
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
-
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ env.DOCKER_USERNAME }}
Expand Down Expand Up @@ -118,7 +113,7 @@ jobs:
run: exit 1
-
name: Push image to GitHub Container Registry
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: ${{ env.GO_RELEASER_VERSION }}
Expand All @@ -135,7 +130,7 @@ jobs:
steps:
-
name: Read Configuration
uses: hashicorp/vault-action@v2
uses: hashicorp/vault-action@v3
id: vault
with:
url: https://vault.eng.aserto.com/
Expand All @@ -151,15 +146,15 @@ jobs:
fetch-depth: 0
-
name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
-
name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ env.DOCKER_USERNAME }}
Expand All @@ -177,7 +172,7 @@ jobs:
ssh-add $HOME/.ssh/id_rsa
-
name: Release
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr_checks.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: pr_checks
on:
pull_request:
Expand All @@ -6,7 +7,7 @@ jobs:
check-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: gitleaks-check
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
.vscode/

go.work.sum
/dist
/.ext
dist/
.ext/
.dev/
41 changes: 22 additions & 19 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ linters-settings:
funlen:
lines: 100
statements: 80
gci:
local-prefixes: github.com/golangci/golangci-lint
goconst:
min-len: 2
min-occurrences: 2
Expand All @@ -34,22 +32,19 @@ linters-settings:
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 22
min-complexity: 18
goimports:
local-prefixes: github.com/golangci/golangci-lint
golint:
min-confidence: 0
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
checks:
- argument
- case
- condition
- return
govet:
check-shadowing: true
shadow: true
settings:
printf:
funcs:
Expand All @@ -75,15 +70,15 @@ linters:
- bodyclose
- dogsled
- errcheck
- exportloopref
- copyloopvar
- exhaustive
- funlen
- gochecknoinits
- goconst
- gocritic
- gocyclo
- godot
# - goerr113 # temporary disabled
- err113
- gofmt
- goimports
- goprintffuncname
Expand All @@ -94,7 +89,7 @@ linters:
- misspell
- nakedret
- noctx
# - rowserrcheck # disable https://github.com/golangci/golangci-lint/issues/2649.
- rowserrcheck
- staticcheck
- stylecheck
- testpackage
Expand Down Expand Up @@ -138,10 +133,18 @@ issues:
- text: "unnamedResult:"
linters:
- gocritic
- path: \.resolvers\.go
text: "typeDefFirst:"
linters:
- gocritic
- path: \.resolvers\.go
text: "paramTypeCombine:"
linters:
- gocritic
- path: \.resolvers\.go
text: "hugeParam:"
linters:
- gocritic
- text: "G404"
linters:
- gosec

run:
timeout: 5m
skip-dirs:
12 changes: 7 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
version: 2
project_name: scim

env:
Expand Down Expand Up @@ -34,7 +36,7 @@ archives:
# https://goreleaser.com/customization/archive/
- format: zip
builds:
- aserto-scim
- aserto-scim
files:
- LICENSE
- README.md
Expand All @@ -47,7 +49,7 @@ checksum:

snapshot:
# https://goreleaser.com/customization/snapshots/
name_template: "{{ .Tag }}"
version_template: "{{ incpatch .Version }}-{{ .ShortCommit }}{{ if .IsGitDirty }}-dirty{{ end }}"

source:
# https://goreleaser.com/customization/source/
Expand Down Expand Up @@ -79,7 +81,7 @@ dockers:
image_templates:
- &amd64-image "{{ .Env.REGISTRY }}/{{ .Env.ORG }}/{{ .Env.REPO }}:{{ .Version }}-amd64"
skip_push: false
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -94,7 +96,7 @@ dockers:
image_templates:
- &arm64-image "{{ .Env.REGISTRY }}/{{ .Env.ORG }}/{{ .Env.REPO }}:{{ .Version }}-arm64"
skip_push: false
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand All @@ -112,4 +114,4 @@ docker_manifests:
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.ORG }}/{{ .Env.REPO }}:{{ .Major }}.{{ .Minor }}"
image_templates: [*amd64-image, *arm64-image]
- name_template: "{{ .Env.REGISTRY }}/{{ .Env.ORG }}/{{ .Env.REPO }}:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
image_templates: [*amd64-image, *arm64-image]
image_templates: [*amd64-image, *arm64-image]
15 changes: 0 additions & 15 deletions Depfile

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ RUN apk add --no-cache bash tzdata

WORKDIR /app

COPY dist/aserto-scim*_linux_amd64_v1/aserto-scim* /app/
COPY aserto-scim /app/

ENTRYPOINT ["./aserto-scim"]
9 changes: 0 additions & 9 deletions Dockerfile.goreleaser

This file was deleted.

Loading

0 comments on commit 2e3b232

Please sign in to comment.