Skip to content

feat(auth): Support API key #108

feat(auth): Support API key

feat(auth): Support API key #108

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
GOPRIVATE: github.com/observiq
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
setup-environment:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Install Tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
vet:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Vet
run: go vet ./...
secure:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Gosec
run: make gosec
check-license:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Check License Headers
run: make check-license
lint:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Lint
run: make lint
check-fmt:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Check Format
run: make check-fmt
misspell:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Misspell
run: make misspell
test-end-to-end:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- uses: KengoTODA/actions-setup-docker-compose@main
with:
version: '2.7.0'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- run: make test-end-to-end
env:
BINDPLANE_LICENSE: ${{ secrets.BINDPLANE_LICENSE }}
build:
# Skip build for dependabot. It takes long and requires our GPG
# key. The `test-end-to-end` job will test building the binary.
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Configure GIT SSH
run: git config --global [email protected]:.insteadOf https://github.com/
- name: Configure SSH Key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.BINDPLANE_ENTERPRISE_SSH_PRIVATE_KEY }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20.5"
- name: Cache Tools
id: tool-cache
uses: actions/cache@v3
with:
path: /home/runner/go/bin
key: tooling-${{ runner.os }}-${{ hashFiles('./internal/tools/go.mod') }}
- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }}
- name: Test GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --snapshot --skip-publish --rm-dist --parallelism 2 --config release/goreleaser.yml
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Scan Binaries
run: lichen --config=./license.yaml $(find dist/provider_* -type f | grep terraform-provider-bindplane | xargs)