Skip to content

Update Dockerfile.e2e #6

Update Dockerfile.e2e

Update Dockerfile.e2e #6

Workflow file for this run

name: libcpp integration
on:
workflow_dispatch:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
env:
OUTPUT_LOCAL_DIR: libcpp-output
STATUS_FILE: libcpp_status
WASM_FILE_NAME: hello.cpp.wasm
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
- name: Build libcpp integration (attempt 1)
id: build_libcpp_try1
continue-on-error: true
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Docker/Dockerfile.e2e
target: libcpp-artifacts
tags: libcpp-integration:latest
outputs: type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
- name: Backoff (after try 1)
if: ${{ always() && steps.build_libcpp_try1.outcome == 'failure' }}
run: sleep 15
- name: Build libcpp integration (attempt 2)
id: build_libcpp_try2
if: ${{ always() && steps.build_libcpp_try1.outcome == 'failure' }}
continue-on-error: true
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Docker/Dockerfile.e2e
target: libcpp-artifacts
tags: libcpp-integration:latest
outputs: type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
- name: Backoff (after try 2)
if: ${{ always() && steps.build_libcpp_try2.outcome == 'failure' }}
run: sleep 30
- name: Build libcpp integration (attempt 3)
id: build_libcpp_try3
if: ${{ always() && steps.build_libcpp_try2.outcome == 'failure' }}
continue-on-error: true
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
with:
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Docker/Dockerfile.e2e
target: libcpp-artifacts
tags: libcpp-integration:latest
outputs: type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
- name: Fail if all build attempts failed
if: ${{ always() && steps.build_libcpp_try1.outcome == 'failure' && steps.build_libcpp_try2.outcome == 'failure' && steps.build_libcpp_try3.outcome == 'failure' }}
run: |
echo "All libcpp build attempts failed"
exit 1
- name: Read libcpp status
id: libcpp
if: ${{ always() }}
shell: bash
run: |
STATUS_PATH="${{ env.OUTPUT_LOCAL_DIR }}/${{ env.STATUS_FILE }}"
echo "Checking status file at: $STATUS_PATH"
echo "----- File contents (if any) -----"
if [[ -f "$STATUS_PATH" ]]; then
cat "$STATUS_PATH"
cat "$STATUS_PATH" >> "$GITHUB_OUTPUT"
cat "$STATUS_PATH" >> "$GITHUB_ENV"
else
echo "(none)"
echo "LIBCPP_STATUS=fail" >> "$GITHUB_OUTPUT"
echo "LIBCPP_STATUS=fail" >> "$GITHUB_ENV"
echo "::warning file=$STATUS_PATH::Status file missing, defaulting to fail"
fi
echo "----------------------------------"
- name: Upload wasm artifact
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: libcpp-wasm
path: ${{ env.OUTPUT_LOCAL_DIR }}/${{ env.WASM_FILE_NAME }}
if-no-files-found: error
retention-days: 7
- name: Upload libcpp status artifact
if: ${{ always() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
name: libcpp-status
path: ${{ env.OUTPUT_LOCAL_DIR }}/${{ env.STATUS_FILE }}
if-no-files-found: error
retention-days: 7
- name: Fail if libcpp integration failed
if: ${{ always() && steps.libcpp.outputs.LIBCPP_STATUS == 'fail' }}
run: |
echo "libcpp integration failed"
exit 1