forked from cerc-io/ipld-eth-server
Update on-pr.yaml
This commit is contained in:
parent
520be6bc86
commit
ef65993412
16
.github/workflows/on-pr.yaml
vendored
16
.github/workflows/on-pr.yaml
vendored
@ -25,9 +25,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Install sshpass
|
|
||||||
run: sudo apt-get install -y sshpass
|
|
||||||
|
|
||||||
# Passed experience with GHA has taught me to store variables in files instead of passing them as variables.
|
# Passed experience with GHA has taught me to store variables in files instead of passing them as variables.
|
||||||
- name: Output variables
|
- name: Output variables
|
||||||
run: |
|
run: |
|
||||||
@ -42,23 +39,28 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
host: ${{ env.BUILD_HOSTNAME }}
|
host: ${{ env.BUILD_HOSTNAME }}
|
||||||
username: ${{ env.BUILD_USERNAME }}
|
username: ${{ env.BUILD_USERNAME }}
|
||||||
passphrase: $ {{ env.BUILD_PASSWORD }}
|
|
||||||
key: ${{ env.BUILD_KEY }}
|
key: ${{ env.BUILD_KEY }}
|
||||||
port: 22
|
port: 22
|
||||||
source: "/tmp/git_repository,/tmp/git_head_ref,./github/workflows/run_unit_test.sh"
|
source: "/tmp/git_repository,/tmp/git_head_ref,./github/workflows/run_unit_test.sh"
|
||||||
target: "/tmp/"
|
target: "/tmp/"
|
||||||
|
|
||||||
- name: Trigger Unit Test
|
- name: Trigger Unit Test
|
||||||
run: echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} ssh {{ env.BUILD_USERNAME }}@{{ env.BUILD_HOSTNAME }} -i /dev/stdin /tmp/run_unit_test.sh
|
uses: appleboy/ssh-action@master
|
||||||
|
with:
|
||||||
|
host: ${{ env.BUILD_HOSTNAME }}
|
||||||
|
username: ${{ env.BUILD_USERNAME }}
|
||||||
|
key: ${{ env.BUILD_KEY }}
|
||||||
|
port: 22
|
||||||
|
script: /tmp/run_unit_test.sh
|
||||||
|
|
||||||
- name: Get the logs and cat them
|
- name: Get the logs and cat them
|
||||||
run: |
|
run: |
|
||||||
echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log .
|
echo ${{ env.BUILD_KEY }} | scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log .
|
||||||
cat ./test.log
|
cat ./test.log
|
||||||
|
|
||||||
- name: Check Error Code
|
- name: Check Error Code
|
||||||
run: |
|
run: |
|
||||||
echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt .
|
echo ${{ env.BUILD_KEY }} | scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt .
|
||||||
[ $(cat ./return_test.txt) -eq 0 ]
|
[ $(cat ./return_test.txt) -eq 0 ]
|
||||||
|
|
||||||
integrationtest:
|
integrationtest:
|
||||||
|
Loading…
Reference in New Issue
Block a user