Skip to content

Commit

Permalink
Pass a folder to upload plugin
Browse files Browse the repository at this point in the history
This way the plugin can upload multiple files to the destination without
path manipulation.
  • Loading branch information
oxve committed May 23, 2024
1 parent 2c0a37f commit 45f23fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions .github/actions/on_device_tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ runs:
uses: isarkis/setup-gcloud@40dce7857b354839efac498d3632050f568090b6 # v1.1.1
- name: Set env vars
env:
GCS_PATH: gs://${PROJECT_NAME}-test-artifacts/${WORKFLOW}/${GITHUB_RUN_NUMBER}/${{ matrix.platform }}_${{ matrix.config }}
WORKFLOW: ${{ github.workflow }}
run: |
echo "PROJECT_NAME=$(gcloud config get-value project)" >> $GITHUB_ENV
echo "GITHUB_RUN_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "WORKFLOW=${WORKFLOW}" >> $GITHUB_ENV
# Boot loader env
if [ "${COBALT_EVERGREEN_LOADER}" != "null" ]; then
Expand All @@ -42,11 +38,12 @@ runs:
echo "SHARD_NAME=unit_test_${{ matrix.shard }}" >> $GITHUB_ENV
echo "TEST_TYPE=unit_test" >> $GITHUB_ENV
echo "USE_SHARDING=1" >> $GITHUB_ENV
echo "GCS_RESULTS=${GCS_PATH}/results.zip" >> $GITHUB_ENV
fi
shell: bash
- name: Run ${{ env.SHARD_NAME }} Tests on ${{ matrix.platform }} Platform
env:
GCS_PATH: gs://${{ env.PROJECT_NAME }}-test-artifacts/${{ github.workflow }}/${{ env.GITHUB_RUN_NUMBER }}/${{ matrix.platform }}_${{ matrix.config }}
GCS_RESULTS_PATH: gs://cobalt-unittest-storage/
GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
Expand All @@ -60,7 +57,9 @@ runs:
GITHUB_COMMIT_AUTHOR_USERNAME: ${{ github.event.commits[0].author.username }}
GITHUB_COMMIT_AUTHOR_EMAIL: ${{ github.event.commits[0].author.email }}
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
GITHUB_WORKFLOW: ${{ github.workflow }}
run: |
set -uxe
python3 -u tools/on_device_tests_gateway_client.py \
Expand All @@ -79,11 +78,11 @@ runs:
${DIMENSION:+"--dimension" "$DIMENSION"} \
${USE_SHARDING:+"--unittest_shard_index" "${{ matrix.shard }}"} \
${ON_DEVICE_TEST_ATTEMPTS:+"--test_attempts" "$ON_DEVICE_TEST_ATTEMPTS"} \
--archive_path ${GCS_PATH}/artifacts.tar \
--gcs_xml_result_path=${GCS_RESULTS}
--archive_path "${GCS_PATH}/artifacts.tar" \
--gcs_xml_result_path "${GCS_PATH}/results/${GITHUB_RUN_ID}/"
--label github \
--label ${GITHUB_EVENT_NAME} \
--label ${WORKFLOW} \
--label ${GITHUB_WORKFLOW} \
--label actor-${GITHUB_ACTOR} \
--label actor_id-${GITHUB_ACTOR_ID} \
--label triggering_actor-${GITHUB_TRIGGERING_ACTOR} \
Expand Down
4 changes: 2 additions & 2 deletions tools/on_device_tests_gateway_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run_trigger_command(self, workdir: str, args: argparse.Namespace):
config=args.config,
tag=args.tag,
labels=args.label,
gcs_xml_result_path=args.gcs_xml_result_path,
gcs_result_path=args.gcs_result_path,
builder_name=args.builder_name,
builder_url=args.builder_url,
change_id=args.change_id,
Expand Down Expand Up @@ -194,7 +194,7 @@ def main():
trigger_parser.add_argument(
'--builder_url', type=str, help='Url to the run, if any.')
trigger_parser.add_argument(
'--gcs_xml_result_path',
'--gcs_result_path',
type=str,
help='GCS url where test result files should be uploaded.')
trigger_parser.add_argument(
Expand Down

0 comments on commit 45f23fb

Please sign in to comment.