Skip to content

Commit

Permalink
add dependabot updates for GitHub Actions and Go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal committed May 13, 2024
1 parent a2309c8 commit 03f7bc5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
"GitHub Actions updates":
patterns:
- "*"
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "monthly"
groups:
"Go modules updates":
dependency-type: "production"
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:

- name: build and test
run: |
go test -timeout=60s -v -covermode=count -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
go test -race -timeout=60s -v -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov_tmp ./...
go build -race ./...
cat $GITHUB_WORKSPACE/profile.cov_tmp | grep -v "_mock.go" > $GITHUB_WORKSPACE/profile.cov
working-directory: app
env:
GOFLAGS: "-mod=vendor"
TZ: "America/Chicago"
MONGO_TEST: mongodb://127.0.0.1:27017

Expand All @@ -42,12 +42,10 @@ jobs:
env:
TZ: "America/Chicago"

- name: install goveralls
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
- name: submit coverage
run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
run: |
go install github.com/mattn/goveralls@latest
goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ ADD . /build/dkll
WORKDIR /build/dkll

RUN \
revison=$(/script/git-rev.sh) && \
echo "revision=${revison}" && \
go build -mod=vendor -o dkll -ldflags "-X main.revision=$revison -s -w" ./app
revision=$(/script/git-rev.sh) && \
echo "revision=${revision}" && \
go build -o dkll -ldflags "-X main.revision=$revision -s -w" ./app


FROM umputun/baseimage:app-latest

# enables automatic changelog generation by tools like Dependabot
LABEL org.opencontainers.image.source="https://github.com/umputun/dkill"

COPY --from=build /build/dkll/dkll /srv/dkll

RUN chown -R app:app /srv
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ WORKDIR /build/dkll
RUN \
rev=$(/script/git-rev.sh) && \
echo "revision=${rev}" && \
GOOS=linux GOARCH=amd64 go build -mod=vendor -o dkll.linux-amd64 -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=linux GOARCH=arm64 go build -mod=vendor -o dkll.linux-arm64 -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=windows GOARCH=amd64 go build -mod=vendor -o dkll.windows-amd64.exe -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=darwin GOARCH=amd64 go build -mod=vendor -o dkll.darwin-amd64 -ldflags "-X main.revision=${rev} -s -w" ./app
GOOS=linux GOARCH=amd64 go build -o dkll.linux-amd64 -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=linux GOARCH=arm64 go build -o dkll.linux-arm64 -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=windows GOARCH=amd64 go build -o dkll.windows-amd64.exe -ldflags "-X main.revision=${rev} -s -w" ./app && \
GOOS=darwin GOARCH=amd64 go build -o dkll.darwin-amd64 -ldflags "-X main.revision=${rev} -s -w" ./app

RUN \
apk add --no-cache --update zip && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ deploy:
docker rm -f dkll.bin

test:
cd app && go test -v -mod=vendor -race ./...
cd app && go test -v -race ./...

lint:
cd app && golangci-lint run --out-format=tab --tests=false ./...
Expand Down

0 comments on commit 03f7bc5

Please sign in to comment.