Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Job #948

Merged
merged 4 commits into from
Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Setup Go Tools
run: make tools

- name: Check Formatting
run: make fmtcheck

- name: Vet Code
run: make vet

- name: Lint Code
run: make lint

- name: Check Build
run: make build

- name: Test
run: make test
10 changes: 5 additions & 5 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ sweep:
@echo "WARNING: This will destroy infrastructure. Use only in development accounts."
go test $(TEST) -v -sweep=$(SWEEP) $(SWEEPARGS)

test: fmtcheck
test:
go test -i $(TEST) || exit 1
echo $(TEST) | \
xargs -t -n4 go test $(TESTARGS) $(TEST_FILTER) -timeout=30s -parallel=4

testacc: fmtcheck
testacc:
TF_ACC=1 go test $(TEST) -v $(TESTARGS) $(TEST_FILTER) -timeout 120m

vet: tools
vet:
@echo "==> Checking source code against go vet and staticcheck"
@go vet ./...
@staticcheck ./...
Expand All @@ -48,7 +48,7 @@ fmt: tools # Format the code
@echo "formatting the code with $(GOFMT)..."
@$(GOFMT) -l -w .

fmtcheck: dep
fmtcheck:
@gofumpt -d -l .

errcheck:
Expand All @@ -62,7 +62,7 @@ test-compile:
fi
go test -c $(TEST) $(TESTARGS)

lint: tools
lint:
@echo "==> Checking source code against linters..."
@$(TFPROVIDERLINT) \
-c 1 \
Expand Down