Skip to content

Add notification rule, project/team scoping, and publisher data source #9

Add notification rule, project/team scoping, and publisher data source

Add notification rule, project/team scoping, and publisher data source #9

Workflow file for this run

name: Tests
on:
pull_request:
paths-ignore:
- "README.md"
- "CHANGELOG.md"
- "LICENSE"
push:
branches:
- main
# Testing only needs permissions to read the repository contents.
permissions:
contents: read
jobs:
# Ensure project builds before running testing matrix
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: latest
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: 'go.mod'
cache: true
# We need the latest version of Terraform for our documentation generation to use
- uses: hashicorp/setup-terraform@5e8dbf3c6d9deaf4193ca7a8fb23f2ac83bb6c85 # v4.0.0
with:
terraform_wrapper: false
- run: make generate
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate' command and commit."; exit 1)
test_tls:
name: Terraform Provider TLS Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
services:
api:
image: dependencytrack/apiserver:${{ matrix.api }}
env:
TELEMETRY_SUBMISSION_ENABLED_DEFAULT: false
ports:
- 8081:8080
strategy:
fail-fast: false
matrix:
api:
# TLS Connectivity is between TF and Nginx, so is independent of API version.
# Full API testing is handled in subsequent jobs. Therefore, this can be the latest supported API version.
- "4.13.6-alpine"
provider:
- "default"
- "rootCA"
- "mtls"
- "rootCA+mtls"
terraform:
- '1.0.*'
- '1.1.*'
- '1.2.*'
- '1.3.*'
- '1.4.*'
- '1.5.*'
- '1.6.*'
- '1.7.*'
- '1.8.*'
- '1.9.*'
- '1.10.*'
- '1.11.*'
- '1.12.*'
- '1.13.*'
- '1.14.*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/test
with:
terraform_version: ${{ matrix.terraform }}
provider_config_key: ${{ matrix.provider }}
# Arbitrarily picked test. Uses Project, as that is the primary resource within DT.
tests_run_regex: "^TestAccProjectResource$"
# Run acceptance tests in a matrix with Terraform CLI versions
test:
name: Terraform Provider Acceptance Tests
needs:
- build
- test_tls
runs-on: ubuntu-latest
timeout-minutes: 15
services:
api:
image: dependencytrack/apiserver:${{ matrix.api.version }}
env:
# TODO: Use external (to DT) DB
#ALPINE_DATABASE_MODE: external
#ALPINE_DATABASE_URL: "jdbc:postgresql://db:5432/dtrack"
#ALPINE_DATABASE_DRIVER: "org.postgresql.Driver"
#ALPINE_DATABASE_USERNAME: dtrack
#ALPINE_DATABASE_PASSWORD: dtrack
TELEMETRY_SUBMISSION_ENABLED_DEFAULT: false
ports:
- 8081:8080
# db:
# image: postgres:17-alpine
# env:
# POSTGRES_DB: dtrack
# POSTGRES_USER: dtrack
# POSTGRES_PASSWORD: dtrack
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# - 5432:5432
strategy:
fail-fast: false
matrix:
api:
- version: "4.11.7"
skip: "^(TestAccTagResource)|(TestAccProjectTagsRead)|(TestAccTagPoliciesResource)|(TestAccTagProjectsResource)|(TestAccProjectCollection)|(TestAccProjectIsLatest)|(TestAccProjectDataSourceIsLatest)$"
- version: "4.12.7"
skip: "^(TestAccTagResource)|(TestAccProjectCollection)$"
- version: "4.13.0"
skip: "^$"
- version: "4.13.1"
skip: "^$"
- version: "4.13.2"
skip: "^$"
- version: "4.13.3"
skip: "^$"
- version: "4.13.4"
skip: "^$"
- version: "4.13.5"
skip: "^$"
- version: "4.13.6"
skip: "^$"
- version: "4.13.6-alpine"
skip: "^$"
terraform:
- '1.0.*'
- '1.1.*'
- '1.2.*'
- '1.3.*'
- '1.4.*'
- '1.5.*'
- '1.6.*'
- '1.7.*'
- '1.8.*'
- '1.9.*'
- '1.10.*'
- '1.11.*'
- '1.12.*'
- '1.13.*'
- '1.14.*'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ./.github/actions/test
with:
terraform_version: ${{ matrix.terraform }}
tests_skip_regex: ${{ matrix.api.skip }}