1+ name : libcpp integration
2+
3+ on :
4+ workflow_dispatch :
5+ push :
6+
7+ concurrency :
8+ group : ${{ github.workflow }}-${{ github.ref }}
9+ cancel-in-progress : true
10+
11+ jobs :
12+ docker :
13+ runs-on : ubuntu-latest
14+ env :
15+ OUTPUT_LOCAL_DIR : libcpp-output
16+ STATUS_FILE : libcpp_status
17+ WASM_FILE_NAME : hello.wasm
18+
19+ steps :
20+ - name : Set up Docker Buildx
21+ uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
22+
23+ - name : Build libcpp integration (attempt 1)
24+ id : build_libcpp_try1
25+ continue-on-error : true
26+ uses : docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
27+ with :
28+ platforms : linux/amd64
29+ cache-from : type=gha
30+ cache-to : type=gha,mode=max
31+ file : Docker/Dockerfile.e2e
32+ target : libcpp-artifacts
33+ tags : libcpp-integration:latest
34+ outputs : type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
35+
36+ - name : Backoff (after try 1)
37+ if : ${{ always() && steps.build_libcpp_try1.outcome == 'failure' }}
38+ run : sleep 15
39+
40+ - name : Build libcpp integration (attempt 2)
41+ id : build_libcpp_try2
42+ if : ${{ always() && steps.build_libcpp_try1.outcome == 'failure' }}
43+ continue-on-error : true
44+ uses : docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
45+ with :
46+ platforms : linux/amd64
47+ cache-from : type=gha
48+ cache-to : type=gha,mode=max
49+ file : Docker/Dockerfile.e2e
50+ target : libcpp-artifacts
51+ tags : libcpp-integration:latest
52+ outputs : type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
53+
54+ - name : Backoff (after try 2)
55+ if : ${{ always() && steps.build_libcpp_try2.outcome == 'failure' }}
56+ run : sleep 30
57+
58+ - name : Build libcpp integration (attempt 3)
59+ id : build_libcpp_try3
60+ if : ${{ always() && steps.build_libcpp_try2.outcome == 'failure' }}
61+ continue-on-error : true
62+ uses : docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
63+ with :
64+ platforms : linux/amd64
65+ cache-from : type=gha
66+ cache-to : type=gha,mode=max
67+ file : Docker/Dockerfile.e2e
68+ target : libcpp-artifacts
69+ tags : libcpp-integration:latest
70+ outputs : type=local,dest=${{ env.OUTPUT_LOCAL_DIR }}
71+
72+ - name : Fail if all build attempts failed
73+ if : ${{ always() && steps.build_libcpp_try1.outcome == 'failure' && steps.build_libcpp_try2.outcome == 'failure' && steps.build_libcpp_try3.outcome == 'failure' }}
74+ run : |
75+ echo "All libcpp build attempts failed"
76+ exit 1
77+
78+ - name : Read libcpp status
79+ id : libcpp
80+ if : ${{ always() }}
81+ shell : bash
82+ run : |
83+ STATUS_PATH="${{ env.OUTPUT_LOCAL_DIR }}/${{ env.STATUS_FILE }}"
84+ echo "Checking status file at: $STATUS_PATH"
85+ echo "----- File contents (if any) -----"
86+ if [[ -f "$STATUS_PATH" ]]; then
87+ cat "$STATUS_PATH"
88+ cat "$STATUS_PATH" >> "$GITHUB_OUTPUT"
89+ cat "$STATUS_PATH" >> "$GITHUB_ENV"
90+ else
91+ echo "(none)"
92+ echo "LIBCPP_STATUS=fail" >> "$GITHUB_OUTPUT"
93+ echo "LIBCPP_STATUS=fail" >> "$GITHUB_ENV"
94+ echo "::warning file=$STATUS_PATH::Status file missing, defaulting to fail"
95+ fi
96+ echo "----------------------------------"
97+
98+ - name : Upload wasm artifact
99+ if : ${{ always() }}
100+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
101+ with :
102+ name : libcpp-wasm
103+ path : ${{ env.OUTPUT_LOCAL_DIR }}/${{ env.WASM_FILE_NAME }}
104+ if-no-files-found : error
105+ retention-days : 7
106+
107+ - name : Upload libcpp status artifact
108+ if : ${{ always() }}
109+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
110+ with :
111+ name : libcpp-status
112+ path : ${{ env.OUTPUT_LOCAL_DIR }}/${{ env.STATUS_FILE }}
113+ if-no-files-found : error
114+ retention-days : 7
115+
116+ - name : Fail if libcpp integration failed
117+ if : ${{ always() && steps.libcpp.outputs.LIBCPP_STATUS == 'fail' }}
118+ run : |
119+ echo "libcpp integration failed"
120+ exit 1
0 commit comments