Skip to content

Commit

Permalink
chore(ci): add github workflow files (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Chen <[email protected]>
  • Loading branch information
jijiechen authored Dec 25, 2024
1 parent cc0e6e4 commit a202959
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 15
labels:
- "dependencies"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 15
labels:
- "dependencies"
54 changes: 54 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request: {}
push:
branches:
- main
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make deps
run: make deps
- name: make check
run: make check
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=10m --verbose
skip-pkg-cache: true
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make deps
run: make deps
- name: make build
run: make build
- name: make run
run: make run
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: always()
with:
name: smoke-report
if-no-files-found: ignore
path: |
raw-report.json
retention-days: ${{ github.event_name == 'pull_request' && 7 || 15 }}
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ require (
k8s.io/api v0.31.3 // indirect
k8s.io/apimachinery v0.31.3 // indirect
k8s.io/client-go v0.31.3
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
)

require github.com/kennygrant/sanitize v1.2.4
require (
github.com/gruntwork-io/terratest v0.47.2
github.com/kennygrant/sanitize v1.2.4 // indirect
)

require (
cel.dev/expr v0.16.0 // indirect
Expand Down Expand Up @@ -84,7 +87,6 @@ require (
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/gruntwork-io/go-commons v0.8.0 // indirect
github.com/gruntwork-io/terratest v0.47.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hoisie/mustache v0.0.0-20160804235033-6375acf62c69 // indirect
Expand Down
2 changes: 1 addition & 1 deletion mk/check.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fmt:
go fmt ./...

.PHONY: check
check: clean tidy fmt generate
check: tidy fmt
# fail if Git working tree is dirty or there are untracked files
git diff --quiet || \
git ls-files --other --directory --exclude-standard --no-empty-directory | wc -l | read UNTRACKED_FILES; if [ "$$UNTRACKED_FILES" != "0" ]; then false; fi || \
Expand Down

0 comments on commit a202959

Please sign in to comment.