@@ -39,51 +39,10 @@ jobs:
3939 id : cache_key
4040 run : echo "CACHE_KEY=${{ steps.lib-version.outputs.url }}-v1" >> $GITHUB_OUTPUT
4141
42- get-dev-artifact :
43- runs-on : ubuntu-latest
44- outputs :
45- cache_key : ${{ steps.cache_key.outputs.CACHE_KEY }}
46- if : ${{ contains(join(github.event.pull_request.labels.*.name), 'release-') && github.event.pull_request.head.repo.fork != 'true' }}
47- steps :
48- - name : Get the version from the label
49- id : label-version
50- run : |
51- echo "${{ join(github.event.pull_request.labels.*.name) }}" | grep -oP "release-\d+.\d+" | xargs > out
52- echo "LIBRARY_VERSION=$(cat out)" >> $GITHUB_OUTPUT
53- mkdir /home/runner/work/lua_libs
54- - name : Find latest artifact
55- id : latest
56- env :
57- ARTIFACTORY_URL : ${{ format('https://smartthings.jfrog.io/artifactory/edge-driver-libs/{0}/', steps.label-version.outputs.LIBRARY_VERSION) }}
58- ARTIFACTORY_USERNAME : ${{ secrets.ARTIFACTORY_USERNAME }}
59- ARTIFACTORY_PASSWORD : ${{ secrets.ARTIFACTORY_PASSWORD }}
60- run : |
61- 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
62- echo "ZIP_FILE=$(cat out)" >> $GITHUB_OUTPUT
63- - name : Try to retrieve cache
64- id : cached-libs
65- uses : actions/cache@v3
66- with :
67- path : ' /home/runner/work/lua_libs'
68- key : ${{ steps.latest.outputs.ZIP_FILE }}-v1
69- - name : Download and unpack specified version
70- if : steps.cached-libs.outputs.cache-hit != 'true'
71- env :
72- ARTIFACTORY_URL : ${{ format('https://smartthings.jfrog.io/artifactory/edge-driver-libs/{0}/{1}', steps.label-version.outputs.LIBRARY_VERSION, steps.latest.outputs.ZIP_FILE) }}
73- ARTIFACTORY_USERNAME : ${{ secrets.ARTIFACTORY_USERNAME }}
74- ARTIFACTORY_PASSWORD : ${{ secrets.ARTIFACTORY_PASSWORD }}
75- working-directory : ' /home/runner/work/lua_libs'
76- run : |
77- wget --user=$ARTIFACTORY_USERNAME --password=$ARTIFACTORY_PASSWORD $ARTIFACTORY_URL -O lua_libs.zip
78- unzip lua_libs.zip
79- - name : Set output
80- id : cache_key
81- run : echo "CACHE_KEY=${{ steps.latest.outputs.ZIP_FILE }}-v1" >> $GITHUB_OUTPUT
82-
8342 run-driver-tests :
8443 runs-on : ubuntu-latest
8544 needs :
86- [ get-latest-release-artifact, get-dev-artifact ]
45+ [ get-latest-release-artifact ]
8746 if : ${{ always() && contains(needs.*.result, 'success') && !contains(needs.*.result, 'failure') }}
8847 steps :
8948 - name : Set cache key
0 commit comments