Skip to content

Commit

Permalink
Use env var instead of gh context
Browse files Browse the repository at this point in the history
  • Loading branch information
oxve committed Sep 21, 2024
1 parent d196fbd commit f97942a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/actions/on_device_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ runs:
if: always() && env.TEST_TYPE == 'unit_test'
env:
COBALT_XMLS_FILENAME: cobalt_xmls.zip
UNIT_TEST_RESULT_PATH: ${{ github.workspace }}/unit-test-results
COBALT_LOGS_DIR: ${{ github.workspace }}/cobalt_logs
UNIT_TEST_RESULT_PATH: ${{ env.GITHUB_WORKSPACE }}/unit-test-results
COBALT_LOGS_DIR: ${{ env.GITHUB_WORKSPACE }}/cobalt_logs
run: |
set -uxe
set -ux
# Forward environment variables for uploading artifacts in later steps.
echo "UNIT_TEST_RESULT_PATH=${UNIT_TEST_RESULT_PATH}" >> $GITHUB_ENV
echo "COBALT_LOGS_DIR=${COBALT_LOGS_DIR}" >> $GITHUB_ENV
mkdir -p "${GITHUB_WORKSPACE}/test_results"
cd "${GITHUB_WORKSPACE}/test_results"
Expand Down Expand Up @@ -127,8 +131,8 @@ runs:
i=$(( ${i} + 1 ))
done
# Print device logs.
cat ${COBALT_ERROR_LOG}
# Print device logs. Continue on error in case the log file didn't download.
cat ${COBALT_ERROR_LOG} || true
# Rename log files for archiving to not expose legacy weirdness.
mkdir -p "${COBALT_LOGS_DIR}/${{ matrix.platform }}/"
Expand All @@ -144,10 +148,6 @@ runs:
echo $tags > ${UNIT_TEST_RESULT_PATH}/${{ matrix.platform }}/TAGS
unzip ${COBALT_XMLS_FILENAME} -d ${RESULT_PATH}
# Forward environment variables for uploading artifacts.
echo "UNIT_TEST_RESULT_PATH=${UNIT_TEST_RESULT_PATH}" >> $GITHUB_ENV
echo "COBALT_LOGS_DIR=${COBALT_LOGS_DIR}" >> $GITHUB_ENV
shell: bash
- name: Archive Unit Test Logs
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit f97942a

Please sign in to comment.