Skip to content

Commit

Permalink
chore(ci): add basic circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
jjacque committed Jun 9, 2024
1 parent 7a780f9 commit 23e53ad
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: 2.1

executors:
golang:
docker:
- image: cimg/go:1.21

jobs:
lint:
executor: golang
steps:
- checkout
# Download and cache dependencies
- restore_cache: &restore-cache
keys:
- go-mod-{{ checksum "go.sum" }}
- run:
name: Install dependencies
command: |
go mod download
- run:
name: Go fmt
command: |
RES="$(gofmt -s -l .)"
if [ -n "${RES}" ]
then
echo "${RES}"
exit 1
fi
- run:
name: Install golangci-lint
command: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
- run:
name: GolangCI Lint
command: golangci-lint run
- save_cache: &save-cache
paths:
- /home/circleci/go/pkg/mod
key: go-mod-{{ checksum "go.sum" }}
test:
executor: golang
steps:
- setup_remote_docker
- checkout
- restore_cache:
<<: *restore-cache
- run:
name: Install dependencies
command: go mod download
- run:
name: Test
command: |
env
unset DOCKER_MACHINE_NAME
make test
- save_cache:
<<: *save-cache

workflows:
lint_test:
jobs:
- lint
- test:
requires:
- lint

0 comments on commit 23e53ad

Please sign in to comment.