Skip to content

[datadog_synthetics_test] Add support for proto files for grpc tests #3702

[datadog_synthetics_test] Add support for proto files for grpc tests

[datadog_synthetics_test] Add support for proto files for grpc tests #3702

Workflow file for this run

name: Run Tests
on:
pull_request:
branches:
- master
schedule:
- cron: "0 1 * * *"
concurrency:
group: ${{ github.head_ref || github.run_id }}-test
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
if: (github.event.action != 'closed' && github.event.pull_request.merged != true) || github.event_name == 'schedule'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pre-commit
run: python -m pip install pre-commit
- name: set PY
run: echo "PY=$(python -c 'import platform;print(platform.python_version())')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure --color=always
linter-checks:
runs-on: ubuntu-latest
steps:
# if we don't do this, `gofmt` will want to rewrite all Go files due to bad line endings,
# because Git will convert all line endings to CRLF when cloning on windows
- name: Set Git to use Linux-style line endings
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
cache: true
- name: Vet
run: make vet
- name: License Check
run: make license-check
- name: Check Docs Are Up To Date
run: make check-docs
test:
strategy:
matrix:
terraform_version:
- "0.13.7"
- "0.15.5"
- "1.1.2"
- "1.5.3"
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
cache: true
- name: Setup terraform CLI
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform_version }}
terraform_wrapper: false
- name: Set TF_ACC_TERRAFORM_PATH env var
run: echo "TF_ACC_TERRAFORM_PATH=$(which terraform)" >> $GITHUB_ENV
- name: Set regex for tests to run
shell: bash
run: |
test_re=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} -- datadog/*.go datadog/*/*.go datadog/internal/* go.mod go.sum | \
sed 's/.*_datadog_\(.*\).*.go/\1/' | sed 's/.*\/.*\/\(.*\).*.go/\1/' | \
sed -E 's+test|_++g' | \
sed -e "s/\(.*\)/\\(?i\\)\1/" | \
xargs | sed -e 's/ /|/g')
if [[ "$test_re" =~ go.mod|go.sum|provider ]] || [[ "${{ github.head_ref }}" = release/* ]] || [[ "${{ github.event_name }}" == "schedule" ]]; then
echo TESTARGS="-run \".*\"" >> $GITHUB_ENV
elif [[ ! -z "$test_re" ]]; then
echo TESTARGS="-run \"${test_re}\"" >> $GITHUB_ENV
fi
- name: Test
shell: bash
run: |
[[ -z "${TESTARGS}" ]] && echo "Skipping tests" || make testall
env:
RECORD: false