Tests #2026
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
name: Tests | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
schedule: | |
- cron: '0 13 * * *' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Get dependencies | |
run: go mod download | |
- name: Build | |
run: | | |
go build -v . | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Get dependencies | |
run: go mod download | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.57 | |
- name: Docs check | |
run: make docs-check | |
test: | |
name: Matrix Test | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
terraform: | |
- '1.3.9' | |
- '1.4.6' | |
- '1.5.1' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Get dependencies | |
run: go mod download | |
- name: TF acceptance tests | |
timeout-minutes: 10 | |
env: | |
TF_ACC: "1" | |
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} | |
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | |
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
run: | | |
go test -v -coverprofile=coverage.out ./internal/... | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.out | |
fail_ci_if_error: true |