-
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #67 from DontShaveTheYak/develop
Release 0.7.0
- Loading branch information
Showing
27 changed files
with
1,288 additions
and
162 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v2.2.2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
@@ -38,21 +38,12 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v2.2.2 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r tests/requirements.txt | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_PUSH_USERNAME }} | ||
password: ${{ secrets.DOCKER_PUSH_TOKEN }} | ||
|
||
- name: Test with pytest | ||
env: | ||
RUNNER_IMAGE: shadycuz/jenkins-std-lib | ||
run: | | ||
pytest | ||
run: pytest |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,80 @@ | ||
/* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, UnnecessaryParenthesesForMethodCallWithClosure, UnusedVariable */ | ||
@Library('pipeline-library') | ||
|
||
import org.dsty.github.actions.Step | ||
|
||
node() { | ||
|
||
// This is needed if you run jenkins in a docker container. | ||
// It's the path on the host machine where your docker bind mount is stored. | ||
// docker run -v '/tmp/jenkins_home:/var/run/jenkins_home' jenkins/jenkins:lts | ||
env.DIND_JENKINS_HOME = '/tmp/jenkins_home' | ||
|
||
String cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
|
||
Step action = new Step(this) | ||
|
||
Map options | ||
|
||
Map outputs | ||
|
||
stage('Docker Action') { | ||
|
||
options = [ | ||
'name': 'Test Docker Action', | ||
'uses': 'actions/hello-world-docker-action@master', | ||
'with': [ | ||
'who-to-greet': 'DockerAction' | ||
] | ||
] | ||
|
||
outputs = action(options) | ||
|
||
if (!outputs.time) { | ||
error('Should have an output named time.') | ||
} | ||
|
||
} | ||
|
||
stage('JavaScript Action') { | ||
|
||
options = [ | ||
'name': 'Test JavaScript Action', | ||
'uses': 'actions/hello-world-javascript-action@master', | ||
'with': [ | ||
'who-to-greet': 'JavaScriptAction' | ||
] | ||
] | ||
|
||
outputs = action(options) | ||
|
||
if (!outputs.time) { | ||
error('Should have an output named time.') | ||
} | ||
|
||
} | ||
|
||
stage('Run Action') { | ||
|
||
options = [ | ||
'name': 'Test RunAction.', | ||
'run': '''\ | ||
echo "Setting an output!" | ||
echo "::set-output name=test::SomeValue" | ||
''' | ||
] | ||
|
||
outputs = action(options) | ||
|
||
if (!outputs.test) { | ||
error('Should have an output named test.') | ||
} | ||
|
||
if (outputs.test != 'SomeValue') { | ||
error('Should set the correct output Value.') | ||
} | ||
|
||
} | ||
|
||
cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
} |
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,39 @@ | ||
/* groovylint-disable DuplicateMapLiteral, DuplicateStringLiteral, Println, UnnecessaryParenthesesForMethodCallWithClosure, UnusedVariable */ | ||
@Library('pipeline-library') | ||
|
||
import org.dsty.github.actions.Step | ||
|
||
node() { | ||
|
||
String cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
|
||
Step action = new Step(this) | ||
|
||
Map options = [ | ||
'name': 'TestIllegalArgument' | ||
] | ||
|
||
try { | ||
Map outputs = action(options) | ||
error("Should not run if 'uses' or 'run' not provided.") | ||
} catch (IllegalArgumentException ex) { | ||
println('Threw the correct exception.') | ||
} | ||
|
||
options = [ | ||
'name': 'TestConditional', | ||
'uses': 'actions/hello-world-docker-action@master', | ||
'with': [ | ||
'who-to-greet': 'Mona the Octocat' | ||
], | ||
'if': false | ||
] | ||
|
||
Map outputs = action(options) | ||
|
||
if (outputs) { | ||
error('Should haved skipped running the step.') | ||
} | ||
|
||
cps = sh(script: '#!/bin/bash\nset +x; > /dev/null 2>&1\necho Test for CPS issue', returnStdout: true) | ||
} |
Oops, something went wrong.