-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c8b9bfa
Showing
48 changed files
with
4,602 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "gomod" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: codeql | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
schedule: | ||
- cron: 11 11 * * 1 # At 11:11 on Monday | ||
jobs: | ||
analyze: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: github/codeql-action/init@v1 | ||
with: | ||
languages: go | ||
- uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: main | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
jobs: | ||
go_build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/[email protected] | ||
- run: go mod download | ||
- run: go build -v . | ||
go_unit_tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/[email protected] | ||
- run: go mod download | ||
- run: go test ./... -timeout 1m | ||
go_acceptance_tests: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
terraform: | ||
- 0.12.31 | ||
- 0.13.7 | ||
- 0.14.11 | ||
- 0.15.5 | ||
- 1.0.11 | ||
- 1.1.2 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/[email protected] | ||
- run: go mod download | ||
- name: Start Mattermost instance | ||
run: docker compose up --wait | ||
- name: Create Mattermost admin user | ||
run: docker compose exec mattermost mmctl --local user create | ||
--email [email protected] | ||
--username admin | ||
--password admin | ||
--disable-welcome-email | ||
- env: | ||
TF_ACC: 1 | ||
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} | ||
MM_URL: http://localhost:8065 | ||
MM_LOGIN_ID: admin | ||
MM_PASSWORD: admin | ||
run: go test ./... -v -timeout 5m | ||
go_generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/[email protected] | ||
- uses: hashicorp/[email protected] | ||
- run: go generate | ||
- name: Check for Git differences | ||
run: git diff --compact-summary --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: [ v* ] | ||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: hashicorp/[email protected] | ||
env: | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
PASSPHRASE: ${{ secrets.PASSPHRASE }} | ||
- uses: goreleaser/[email protected] | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
ldflags: | ||
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' | ||
goos: | ||
- freebsd | ||
- windows | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- '386' | ||
- arm | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: '{{ .ProjectName }}_v{{ .Version }}' | ||
archives: | ||
- format: zip | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
checksum: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
signs: | ||
- artifacts: checksum | ||
args: | ||
- "--batch" | ||
- "--local-user" | ||
- "{{ .Env.GPG_FINGERPRINT }}" | ||
- "--output" | ||
- "${signature}" | ||
- "--detach-sign" | ||
- "${artifact}" | ||
release: | ||
extra_files: | ||
- glob: 'terraform-registry-manifest.json' | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' | ||
changelog: | ||
skip: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 0.1.0 (Unreleased) | ||
|
||
BACKWARDS INCOMPATIBILITIES / NOTES: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.DEFAULT_GOAL := help | ||
|
||
# Path to the docker-compose binary | ||
DOCKER_COMPOSE_BIN ?= docker compose | ||
|
||
.PHONY: help | ||
help: ## Show this help | ||
@awk 'BEGIN {FS = ":.*?## "} /^[%a-zA-Z0-9_-]+:.*?## / {printf "%-20s%s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
.PHONY: up | ||
up: ## Spin up local testing infrastructure | ||
$(DOCKER_COMPOSE_BIN) up --wait | ||
$(DOCKER_COMPOSE_BIN) exec mattermost mmctl --local user create \ | ||
--email [email protected] \ | ||
--username admin \ | ||
--password admin \ | ||
--disable-welcome-email | ||
$(DOCKER_COMPOSE_BIN) exec mattermost mmctl --local token generate admin 'For local testing' | ||
|
||
.PHONY: down | ||
down: ## Destroy local testing infrastructure | ||
$(DOCKER_COMPOSE_BIN) down | ||
|
||
.PHONY: testacc | ||
testacc: export TF_ACC=1 | ||
testacc: export MM_URL=http://localhost:8065 | ||
testacc: export MM_LOGIN_ID=admin | ||
testacc: export MM_PASSWORD=admin | ||
testacc: ## Run acceptance tests | ||
go test ./... -v $(TESTARGS) -timeout 2m | ||
|
||
.PHONY: test | ||
test: ## Run unit tests | ||
go test ./... $(TESTARGS) |
Oops, something went wrong.