Skip to content

Commit d13a48b

Browse files
authored
add GH CI workflow (#28)
* add lint and build * move file to correct folder * adds scripts dir * remove proto buf check
1 parent dc750dd commit d13a48b

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

.github/workflows/ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Arkeo Directory Indexer and API
2+
run-name: ${{ github.actor }} is testing a code change 🚀
3+
on: [push]
4+
5+
# This allows a subsequently queued workflow run to interrupt previous runs
6+
concurrency:
7+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
8+
cancel-in-progress: true
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out repository code
15+
uses: actions/checkout@v3
16+
- name: Setup Golang
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.19
20+
cache: true
21+
- name: Lint code
22+
run: |
23+
make lint
24+
make build

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@ run-api: build
2525
go run cmd/api/main.go --env=./docker/dev/local.env
2626

2727
db-migrate:
28-
tern migrate -c db/tern.conf -m db
28+
tern migrate -c db/tern.conf -m db
29+
30+
lint:
31+
@./scripts/lint.sh

scripts/lint.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
die() {
5+
echo "ERR: $*"
6+
exit 1
7+
}
8+
9+
if [ -n "$(git ls-files '*.go' | grep -v -E '.pb.gw.go' | grep -v -e '^docs/' | xargs gofumpt -l 2>/dev/null)" ]; then
10+
git ls-files '*.go' | grep -v -E '.pb.gw.go' | grep -v -e '^docs/' | xargs gofumpt -d 2>/dev/null
11+
die "Go formatting errors"
12+
fi
13+
14+
go mod verify

0 commit comments

Comments
 (0)