@@ -20,7 +20,6 @@ permissions:
20
20
21
21
jobs :
22
22
build :
23
- if : github.event.issue.pull_request && contains(github.event.comment.body, '/run-testacc')
24
23
name : Build
25
24
runs-on : ubuntu-latest
26
25
timeout-minutes : 5
37
36
# This job runs on issue_comment event with /run-testacc command.
38
37
# We will block merging to main unless this job passes
39
38
# The reason we don't want to run this on every push is because it's expensive/creates real resources
40
- if : ${{ github.event_name == 'issue_comment' && github. event.issue.pull_request && contains(github.event.comment.body, '/run- testacc') }}
41
- name : Terraform Provider Acceptance Tests
39
+ if : ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/testacc') }}
40
+ name : PR Terraform Provider Acceptance Tests
42
41
needs : build
43
42
runs-on : ubuntu-latest
44
43
environment : dev
@@ -51,25 +50,37 @@ jobs:
51
50
- ' 1.7.*'
52
51
- ' 1.6.*'
53
52
steps :
54
- - uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
53
+ - name : Get PR branch
54
+ uses : xt0rted/pull-request-comment-branch@v1
55
+ id : comment-branch
56
+ - name : Set latest commit status as pending
57
+ uses : myrotvorets/set-commit-status-action@master
58
+ with :
59
+ sha : ${{ steps.comment-branch.outputs.head_sha }}
60
+ token : ${{ secrets.GITHUB_TOKEN }}
61
+ status : pending
62
+ - name : Checkout PR branch
63
+ uses : actions/checkout@v3
64
+ with :
65
+ ref : ${{ steps.comment-branch.outputs.head_ref }}
55
66
- uses : actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
56
67
with :
57
68
go-version-file : ' go.mod'
58
69
cache : true
59
- - uses : hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
60
- with :
61
- terraform_version : ${{ matrix.terraform }}
62
- terraform_wrapper : false
63
70
- run : go mod download
64
- - env :
65
- TF_ACC : " 1"
66
- run : make testacc
67
- timeout-minutes : 10
71
+ - run : go build -v .
72
+ - name : Set latest commit status as ${{ job.status }}
73
+ uses : myrotvorets/set-commit-status-action@master
74
+ if : always()
75
+ with :
76
+ sha : ${{ steps.comment-branch.outputs.head_sha }}
77
+ token : ${{ secrets.GITHUB_TOKEN }}
78
+ status : ${{ job.status }}
68
79
69
80
main-testacc :
70
81
# This job runs on push to main branch.
71
82
if : ${{ github.event_name == 'push' }}
72
- name : Terraform Provider Acceptance Tests
83
+ name : Main Terraform Provider Acceptance Tests
73
84
needs : build
74
85
environment : dev
75
86
timeout-minutes : 15
0 commit comments