|
2 | 2 | name: Acceptance Tests
|
3 | 3 |
|
4 | 4 | on:
|
5 |
| - issue_comment: |
6 |
| - types: |
7 |
| - - created |
| 5 | + pull_request: |
| 6 | + paths-ignore: |
| 7 | + - 'README.md' |
8 | 8 | push:
|
9 | 9 | branches:
|
10 | 10 | - main
|
|
29 | 29 | - run: go mod download
|
30 | 30 | - run: go build -v .
|
31 | 31 |
|
32 |
| - comment-triggered-testacc: |
33 |
| - # This job runs on issue_comment event with /testacc command. |
34 |
| - # We will block merging to main unless this job passes |
35 |
| - # The reason we don't want to run this on every push is because it's expensive/creates real resources |
36 |
| - if: github.event.issue.pull_request && contains(github.event.comment.body, '/testacc') |
37 |
| - name: PR Terraform Provider Acceptance Tests |
38 |
| - needs: build |
39 |
| - runs-on: ubuntu-latest |
40 |
| - timeout-minutes: 15 |
41 |
| - strategy: |
42 |
| - fail-fast: true |
43 |
| - matrix: |
44 |
| - # list whatever Terraform versions here you would like to support |
45 |
| - terraform: |
46 |
| - - '1.7.*' |
47 |
| - - '1.6.*' |
48 |
| - steps: |
49 |
| - - name: Get PR branch |
50 |
| - uses: xt0rted/pull-request-comment-branch@v1 |
51 |
| - id: comment-branch |
52 |
| - - name: Set latest commit status as pending |
53 |
| - uses: myrotvorets/set-commit-status-action@master |
54 |
| - with: |
55 |
| - sha: ${{ steps.comment-branch.outputs.head_sha }} |
56 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
57 |
| - status: pending |
58 |
| - - name: Checkout PR branch |
59 |
| - uses: actions/checkout@v3 |
60 |
| - with: |
61 |
| - ref: ${{ steps.comment-branch.outputs.head_ref }} |
62 |
| - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 |
63 |
| - with: |
64 |
| - go-version-file: 'go.mod' |
65 |
| - cache: true |
66 |
| - - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0 |
67 |
| - with: |
68 |
| - terraform_version: ${{ matrix.terraform }} |
69 |
| - terraform_wrapper: false |
70 |
| - - run: go mod download |
71 |
| - - env: |
72 |
| - TF_ACC: "1" |
73 |
| - ASTRO_API_TOKEN: ${{ secrets.DEV_ASTRO_API_TOKEN }} |
74 |
| - ASTRO_API_HOST: ${{ secrets.DEV_ASTRO_API_HOST }} |
75 |
| - ASTRO_ORGANIZATION_ID: ${{ secrets.DEV_ASTRO_ORGANIZATION_ID }} |
76 |
| - run: make testacc |
77 |
| - timeout-minutes: 10 |
78 |
| - - name: Set latest commit status as ${{ job.status }} |
79 |
| - uses: myrotvorets/set-commit-status-action@master |
80 |
| - if: always() |
81 |
| - with: |
82 |
| - sha: ${{ steps.comment-branch.outputs.head_sha }} |
83 |
| - token: ${{ secrets.GITHUB_TOKEN }} |
84 |
| - status: ${{ job.status }} |
85 |
| - |
86 |
| - main-testacc: |
| 32 | + testacc: |
87 | 33 | # This job runs on push to main branch.
|
88 |
| - if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
89 |
| - name: Main Terraform Provider Acceptance Tests |
| 34 | + name: Terraform Provider Acceptance Tests |
90 | 35 | needs: build
|
91 | 36 | timeout-minutes: 15
|
92 | 37 | strategy:
|
@@ -116,11 +61,3 @@ jobs:
|
116 | 61 | run: make testacc
|
117 | 62 | timeout-minutes: 10
|
118 | 63 |
|
119 |
| - debug: |
120 |
| - if: github.event_name == 'issue_comment' |
121 |
| - runs-on: ubuntu-latest |
122 |
| - steps: |
123 |
| - - name: Dump GitHub context |
124 |
| - env: |
125 |
| - GITHUB_CONTEXT: ${{ toJson(github) }} |
126 |
| - run: echo "$GITHUB_CONTEXT" |
0 commit comments