forked from integrations/terraform-provider-github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request integrations#375 from terraform-providers/acceptan…
…ce-tests Adds acceptance test runs triggered by labels
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |