Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/jenkins-driver-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run Jenkins driver tests
on:
pull_request:
paths:
- 'drivers/**'

jobs:
trigger-driver-test:
strategy:
matrix:
version:
[ 60 ]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will we expand this to and when can we do that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question mainly for @varzac. Chats about maybe going back to 52, but for sure looking to go to 59 at least. Currently working on a script that makes it easier to backport the tagging of tests to earlier versions of lua-libs.


runs-on: ubuntu-latest
steps:

- name: Create Commit Status (Pending)
id: status
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd
with:
script: |
core.setOutput('status_url', (await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: 'pending',
description: 'Jenkins job triggered...',
context: 'Driver Tests (${{ matrix.version }})'
})).data.url);
- name: Trigger Jenkins Generic Webhook
env:
JENKINS_WEBHOOK_TOKEN: ${{ secrets.JENKINS_WEBHOOK_TOKEN }}
JENKINS_WEBHOOK_URL: ${{ secrets.JENKINS_WEBHOOK_URL }}
STATUS_URL: ${{ steps.status.outputs.status_url }}
run: |
set +x
curl -s -o /dev/null -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${JENKINS_WEBHOOK_TOKEN}" \
-d "{\"status_url\": \"$STATUS_URL\",
\"version\": ${{ matrix.version }},
\"commit\": ${{ github.event.pull_request.head.sha }} }" \
"${JENKINS_WEBHOOK_URL}"
set -x
43 changes: 1 addition & 42 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,10 @@ jobs:
id: cache_key
run: echo "CACHE_KEY=${{ steps.lib-version.outputs.url }}-v1" >> $GITHUB_OUTPUT

get-dev-artifact:
runs-on: ubuntu-latest
outputs:
cache_key: ${{ steps.cache_key.outputs.CACHE_KEY }}
if: ${{ contains(join(github.event.pull_request.labels.*.name), 'release-') && github.event.pull_request.head.repo.fork != 'true' }}
steps:
- name: Get the version from the label
id: label-version
run: |
echo "${{ join(github.event.pull_request.labels.*.name) }}" | grep -oP "release-\d+.\d+" | xargs > out
echo "LIBRARY_VERSION=$(cat out)" >> $GITHUB_OUTPUT
mkdir /home/runner/work/lua_libs
- name: Find latest artifact
id: latest
env:
ARTIFACTORY_URL: ${{ format('https://smartthings.jfrog.io/artifactory/edge-driver-libs/{0}/', steps.label-version.outputs.LIBRARY_VERSION) }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: |
wget --user=$ARTIFACTORY_USERNAME --password=$ARTIFACTORY_PASSWORD $ARTIFACTORY_URL -q -O - | grep '.zip' | awk -F' ' '{print $3"-"$4"\t"$2}' | sort -t - -k3n -k2M -k1n -k4n | tail -1 | grep -o 'lua_libs_[a-z0-9_]*.zip' | head -1 > out
echo "ZIP_FILE=$(cat out)" >> $GITHUB_OUTPUT
- name: Try to retrieve cache
id: cached-libs
uses: actions/cache@v3
with:
path: '/home/runner/work/lua_libs'
key: ${{ steps.latest.outputs.ZIP_FILE }}-v1
- name: Download and unpack specified version
if: steps.cached-libs.outputs.cache-hit != 'true'
env:
ARTIFACTORY_URL: ${{ format('https://smartthings.jfrog.io/artifactory/edge-driver-libs/{0}/{1}', steps.label-version.outputs.LIBRARY_VERSION, steps.latest.outputs.ZIP_FILE) }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
working-directory: '/home/runner/work/lua_libs'
run: |
wget --user=$ARTIFACTORY_USERNAME --password=$ARTIFACTORY_PASSWORD $ARTIFACTORY_URL -O lua_libs.zip
unzip lua_libs.zip
- name: Set output
id: cache_key
run: echo "CACHE_KEY=${{ steps.latest.outputs.ZIP_FILE }}-v1" >> $GITHUB_OUTPUT

run-driver-tests:
runs-on: ubuntu-latest
needs:
[ get-latest-release-artifact, get-dev-artifact ]
[ get-latest-release-artifact ]
if: ${{ always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') }}
steps:
- name: Set cache key
Expand Down