Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from gotwarlost/add-checks
Browse files Browse the repository at this point in the history
simplify build, add docker build
  • Loading branch information
gotwarlost authored Oct 29, 2023
2 parents cacb330 + 431d210 commit 02ab7c2
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 44 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check-license-headers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: check license headers
on:
pull_request:
push:
branches:
- main
jobs:
check-gen:
name: check license headers
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v3
with:
fetch-depth: "0"
- id: go
uses: actions/setup-go@v4
with:
go-version: 1.21
cache: false
- name: checks
run: |
./scripts/check/check-license-header.sh
44 changes: 0 additions & 44 deletions .github/workflows/ci.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: docker build
on:
pull_request:
push:
branches:
- main
jobs:
docker-build:
name: build docker image
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: setup
run: |
LDFLAGS="$(make ci-print-ldflags)"
echo "LDFLAGS=${LDFLAGS}">>$GITHUB_ENV
- name: docker build
uses: docker/build-push-action@v5
with:
build-args:
ldflags=${{ env.LDFLAGS }}
25 changes: 25 additions & 0 deletions .github/workflows/go-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: go build
on:
pull_request:
push:
branches:
- main
jobs:
go-build:
name: build and test Go code
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v3
with:
fetch-depth: "0"
- id: go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Build, test and lint
run: |
make ci
- name: check dirty files from go generate
run: |
make ci-check-dirty
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,11 @@ fmt: .bin/gofumpt
.PHONY: ci
ci: local

.PHONY: ci-print-ldflags
ci-print-ldflags:
@echo $(ldflags)

.PHONY: ci-check-dirty
ci-check-dirty:
git status || true
git diff --quiet || (echo 'dirty files found' && exit 1)

0 comments on commit 02ab7c2

Please sign in to comment.