File tree 1 file changed +19
-1
lines changed 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 47
47
git config --global core.eol lf
48
48
- name : Checkout code
49
49
uses : actions/checkout@v3
50
+ with :
51
+ fetch-depth : 0
50
52
- name : Install Go
51
53
uses : actions/setup-go@v3
52
54
with :
69
71
run : echo ("TF_ACC_TERRAFORM_PATH=" + (Get-Command terraform).Path) >> $env:GITHUB_ENV
70
72
- name : Check Docs Are Up To Date
71
73
run : make check-docs
74
+ - name : Set regex for tests to run
75
+ shell : bash
76
+ run : |
77
+ 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 | \
78
+ sed 's/.*_datadog_\(.*\).*.go/\1/' | sed 's/.*\/.*\/\(.*\).*.go/\1/' | \
79
+ sed -E 's+test|_++g' | \
80
+ sed -e "s/\(.*\)/\\(?i\\)\1/" | \
81
+ xargs | sed -e 's/ /|/g')
82
+
83
+ if [[ "$test_re" =~ go.mod|go.sum|provider ]] || [[ ${{ github.head_ref }} = release/* ]]; then
84
+ echo TESTARGS="-run \".*\"" >> $GITHUB_ENV
85
+ elif [[ ! -z "$test_re" ]]; then
86
+ echo TESTARGS="-run \"${test_re}\"" >> $GITHUB_ENV
87
+ fi
72
88
- name : Test
73
- run : make testall
89
+ shell : bash
90
+ run : |
91
+ [[ -z "${TESTARGS}" ]] && echo "Skipping tests" || make testall
74
92
env :
75
93
RECORD : false
You can’t perform that action at this time.
0 commit comments