Skip to content

Commit a63eecb

Browse files
authored
Generate provider docs (#229)
1 parent cb9f554 commit a63eecb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2009
-1184
lines changed

.github/argo-cd.png

105 KB
Loading

.github/tf.png

25.7 KB
Loading

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout repository
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
1414
with:
1515
fetch-depth: 0
1616

.github/workflows/tests.yml

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,57 @@ on:
88
branches: [master]
99

1010
jobs:
11+
build:
12+
name: Build
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 5
15+
16+
steps:
17+
18+
- name: Check out code into the Go module directory
19+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
23+
with:
24+
go-version-file: 'go.mod'
25+
id: go
26+
27+
# TODO: Add linting (in upcoming PR)
28+
# - name: Run linters
29+
# uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # v3.3.1
30+
# with:
31+
# version: latest
32+
33+
- name: Generate
34+
run: make generate
35+
36+
- name: Confirm no diff
37+
run: |
38+
git diff --compact-summary --exit-code || \
39+
(echo "*** Unexpected differences after code generation. Run 'make generate' and commit."; exit 1)
40+
41+
- name: Build
42+
run: make build
43+
1144
acceptance_tests:
1245
name: Acceptance Tests
46+
needs: build
1347
runs-on: ubuntu-latest
48+
timeout-minutes: 20
1449
strategy:
1550
fail-fast: false
1651
matrix:
1752
argocd_version: ["v2.5.0", "v2.4.12", "v2.3.9"]
1853
steps:
19-
- uses: actions/checkout@v2
20-
- uses: actions/setup-go@v1
21-
with:
22-
go-version: 1.19
23-
id: go
24-
- name: Restore Go cache
25-
uses: actions/cache@v1
54+
- name: Check out code
55+
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
56+
57+
- name: Setup Go
58+
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
2659
with:
27-
path: ~/go/pkg/mod
28-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29-
restore-keys: |
30-
${{ runner.os }}-go-
60+
go-version-file: 'go.mod'
61+
check-latest: true
3162

3263
- name: Install Kustomize
3364
run: |
@@ -51,4 +82,4 @@ jobs:
5182
- name: Run acceptance tests
5283
env:
5384
ARGOCD_VERSION: ${{ matrix.argocd_version }}
54-
run: sh scripts/testacc.sh
85+
run: make testacc

GNUmakefile

Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,43 @@
1-
TEST?=./...
2-
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
3-
PKG_NAME=pass
1+
default: build
42

5-
BINARY=terraform-provider-argocd
6-
VERSION = $(shell git describe --always)
3+
ARGOCD_INSECURE?=true
4+
ARGOCD_SERVER?=127.0.0.1:8080
5+
ARGOCD_AUTH_USERNAME?=admin
6+
ARGOCD_AUTH_PASSWORD?=acceptancetesting
7+
ARGOCD_CONTEXT?=kind-argocd
8+
ARGOCD_VERSION?=v2.5.0
79

8-
default: build-all
10+
export
911

10-
build-all: linux windows darwin freebsd
12+
build:
13+
go build -v ./...
1114

12-
install: fmtcheck
13-
go install
15+
install: build
16+
go install -v ./...
1417

15-
linux: fmtcheck
16-
@mkdir -p bin/
17-
GOOS=linux GOARCH=amd64 go build -v -o bin/$(BINARY)_$(VERSION)_linux_amd64
18-
GOOS=linux GOARCH=386 go build -v -o bin/$(BINARY)_$(VERSION)_linux_x86
19-
20-
windows: fmtcheck
21-
@mkdir -p bin/
22-
GOOS=windows GOARCH=amd64 go build -v -o bin/$(BINARY)_$(VERSION)_windows_amd64
23-
GOOS=windows GOARCH=386 go build -v -o bin/$(BINARY)_$(VERSION)_windows_x86
24-
25-
darwin: fmtcheck
26-
@mkdir -p bin/
27-
GOOS=darwin GOARCH=amd64 go build -v -o bin/$(BINARY)_$(VERSION)_darwin_amd64
28-
GOOS=darwin GOARCH=arm64 go build -v -o bin/$(BINARY)_$(VERSION)_darwin_arm64
29-
30-
freebsd: fmtcheck
31-
@mkdir -p bin/
32-
GOOS=freebsd GOARCH=amd64 go build -v -o bin/$(BINARY)_$(VERSION)_freebsd_amd64
33-
GOOS=freebsd GOARCH=386 go build -v -o bin/$(BINARY)_$(VERSION)_freebsd_x86
18+
# See https://golangci-lint.run/
19+
lint:
20+
golangci-lint run
3421

35-
release: clean linux windows darwin freebsd
36-
for f in $(shell ls bin/); do zip bin/$${f}.zip bin/$${f}; done
22+
generate:
23+
go generate ./...
3724

38-
clean:
39-
git clean -fXd -e \!vendor -e \!vendor/**/* -e \!.vscode
25+
fmt:
26+
gofmt -s -w -e .
4027

41-
test: fmtcheck
42-
go test $(TEST) -timeout=30s -parallel=4
43-
44-
testacc_prepare_env:
45-
sh scripts/testacc_prepare_env.sh
28+
test:
29+
go test -v -cover -timeout=120s -parallel=4 ./...
4630

4731
testacc:
48-
sh scripts/testacc.sh
32+
TF_ACC=1 go test -v -cover -timeout 8m ./...
4933

5034
testacc_clean_env:
5135
kind delete cluster --name argocd
5236

53-
fmt:
54-
@echo "==> Fixing source code with gofmt..."
55-
gofmt -s -w ./$(PKG_NAME)
56-
57-
# Currently required by tf-deploy compile
58-
fmtcheck:
59-
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"
60-
61-
lint:
62-
@echo "==> Checking source code against linters..."
63-
@GOGC=30 golangci-lint run ./$(PKG_NAME)
64-
65-
test-compile:
66-
@if [ "$(TEST)" = "./..." ]; then \
67-
echo "ERROR: Set TEST to a specific package. For example,"; \
68-
echo " make test-compile TEST=./$(PKG_NAME)"; \
69-
exit 1; \
70-
fi
71-
go test -c $(TEST) $(TESTARGS)
72-
73-
vendor:
74-
go mod tidy
75-
go mod vendor
76-
77-
vet:
78-
go vet $<
37+
testacc_prepare_env:
38+
sh scripts/testacc_prepare_env.sh
39+
40+
clean:
41+
git clean -fXd -e \!vendor -e \!vendor/**/* -e \!.vscode
7942

80-
.PHONY: build test testacc_prepare_env testacc testacc_clean_env fmt fmtcheck lint test-compile vendor
43+
.PHONY: build install lint generate fmt test testacc testacc_clean_env testacc_prepare_env clean

0 commit comments

Comments
 (0)