Skip to content

Commit

Permalink
Merge pull request integrations#375 from terraform-providers/acceptan…
Browse files Browse the repository at this point in the history
…ce-tests

Adds acceptance test runs triggered by labels
  • Loading branch information
Jeremy Udit authored Mar 5, 2020
2 parents af0731c + e3d125f commit 0a87bf1
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Acceptance Tests

on:
pull_request:
types: [labeled]

jobs:
acceptance-tests:
runs-on: ubuntu-latest
steps:

- name: Parse Context From Environment
run: |
echo ::set-env name=HEAD_SHA::$(
jq -rc '.pull_request.head.sha' $GITHUB_EVENT_PATH
)
echo ::set-env name=LABEL_NAME::$(
jq -rc .label.name $GITHUB_EVENT_PATH
)
- name: Parse Arguments From Label Name
run: |
echo ::set-env name=RUN_FILTER::$(
echo $LABEL_NAME | cut -d/ -f 2
)
- name: Match Expected Label Prefix
run: echo ${LABEL_NAME} | egrep -q "^acceptance-test/"

- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ env.HEAD_SHA }}

- name: Generate Test Fixtures
run: |
openssl req -x509 -newkey rsa:4096 -days 1 -nodes \
-subj "/C=US/ST=CA/L=San Francisco/O=HashiCorp, Inc./CN=localhost" \
-keyout github/test-fixtures/key.pem -out github/test-fixtures/cert.pem
- name: Acceptance Tests
uses: terraformtesting/[email protected]
with:
RUN_FILTER: ${{ env.RUN_FILTER }}
GITHUB_ORGANIZATION: terraformtesting
GITHUB_TEST_USER: github-terraform-test-user
GITHUB_TEST_USER_NAME: "Test User"
GITHUB_TEST_USER_EMAIL: [email protected]
GITHUB_TEST_USER_TOKEN: ${{ secrets.GITHUB_TEST_USER_TOKEN }}
GITHUB_TEST_COLLABORATOR: github-terraform-test-collaborator
GITHUB_TEST_COLLABORATOR_TOKEN: ${{ secrets.GITHUB_TEST_COLLABORATOR_TOKEN }}
GITHUB_TEMPLATE_REPOSITORY: terraform-template-module
GITHUB_TEMPLATE_REPOSITORY_RELEASE_ID: 23826477

0 comments on commit 0a87bf1

Please sign in to comment.