generated from ShahradR/git-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add action input param to upgrade taskcat
Add the update_taskcat input parameter to the GitHub Action based on feedback received in #82. When set to true, the script runs `pip install --upgrade taskcat`, upgrading taskcat to the latest version before running tests. The --minimal-output flag was also added to the script to help with logging issues. See 9111ae4 for more details. Note that the parameter name uses an underscore instead of a hyphen to separate "update" and "taskcat". This is because the input is read as an environment variable, and only ASCII characters + underscores are allowed. Associated issue: #82
- Loading branch information
Showing
10 changed files
with
187 additions
and
4 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
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
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
26 changes: 26 additions & 0 deletions
26
e2e/resources/taskcat_upgrade/false/.github/workflows/main.yaml
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,26 @@ | ||
--- | ||
on: [push] | ||
|
||
jobs: | ||
taskcat: | ||
runs-on: ubuntu-latest | ||
name: taskcat | ||
# Cannot use GitHub Action's "services" feature due to an issue in act. See nektos/act#173 for more details. | ||
# services: | ||
# moto: | ||
# image: motoserver/moto | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: set PY | ||
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" | ||
- name: taskcat | ||
uses: ./../../../../ | ||
with: | ||
commands: test run | ||
update_taskcat: false | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
AWS_SESSION_TOKEN: ${{secrets.AWS_SESSION_TOKEN}} |
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,10 @@ | ||
--- | ||
project: | ||
name: action-taskcat-default | ||
owner: shahrad@rezaei.io | ||
|
||
tests: | ||
default: | ||
template: templates/dummyStack.yaml | ||
regions: | ||
- ca-central-1 |
16 changes: 16 additions & 0 deletions
16
e2e/resources/taskcat_upgrade/false/templates/dummyStack.yaml
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,16 @@ | ||
--- | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
|
||
Description: | | ||
Dummy CloudFormation template used with taskcat test scenarios. This | ||
template attempts to create a dummy resource, but the condition is always | ||
false - as such, this template never creates anything. | ||
Conditions: | ||
AlwaysFalse: | ||
Fn::Equals: [true, false] | ||
|
||
Resources: | ||
DummyResource: | ||
Type: Custom::DummyResource | ||
Condition: AlwaysFalse |
26 changes: 26 additions & 0 deletions
26
e2e/resources/taskcat_upgrade/true/.github/workflows/main.yaml
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,26 @@ | ||
--- | ||
on: [push] | ||
|
||
jobs: | ||
taskcat: | ||
runs-on: ubuntu-latest | ||
name: taskcat | ||
# Cannot use GitHub Action's "services" feature due to an issue in act. See nektos/act#173 for more details. | ||
# services: | ||
# moto: | ||
# image: motoserver/moto | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: set PY | ||
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" | ||
- name: taskcat | ||
uses: ./../../../../ | ||
with: | ||
commands: test run | ||
update_taskcat: true | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | ||
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||
AWS_SESSION_TOKEN: ${{secrets.AWS_SESSION_TOKEN}} |
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,10 @@ | ||
--- | ||
project: | ||
name: action-taskcat-default | ||
owner: shahrad@rezaei.io | ||
|
||
tests: | ||
default: | ||
template: templates/dummyStack.yaml | ||
regions: | ||
- ca-central-1 |
16 changes: 16 additions & 0 deletions
16
e2e/resources/taskcat_upgrade/true/templates/dummyStack.yaml
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,16 @@ | ||
--- | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
|
||
Description: | | ||
Dummy CloudFormation template used with taskcat test scenarios. This | ||
template attempts to create a dummy resource, but the condition is always | ||
false - as such, this template never creates anything. | ||
Conditions: | ||
AlwaysFalse: | ||
Fn::Equals: [true, false] | ||
|
||
Resources: | ||
DummyResource: | ||
Type: Custom::DummyResource | ||
Condition: AlwaysFalse |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#! /bin/sh | ||
|
||
taskcat $@ | ||
if [ "${INPUT_UPDATE_TASKCAT}" == "true" ]; then | ||
pip install --upgrade taskcat | ||
fi | ||
|
||
taskcat $@ --minimal-output |