55 branches :
66 - master
77 tags :
8- - ' * '
8+ - " * "
99 pull_request :
1010 release :
1111 types : [published]
1919 # the only time system test image needs to be defined for a push is when it's a non 'v' tag creation
2020 PUSH_ENABLED : ${{ secrets.DOCKERHUB_TOKEN && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') != true && 'true' || 'false' }}
2121 IMAGE : ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.ref_type == 'tag' && github.ref_name || github.event.ref || 'latest') }}
22- CORE_GIT_REF : https://github.com/stellar/stellar-core.git#master
23- STELLAR_RPC_GIT_REF : https://github.com/stellar/stellar-rpc.git#protocol-23
24- RUST_TOOLCHAIN_VERSION : stable
2522 SOROBAN_CLI_GIT_REF : https://github.com/stellar/soroban-tools.git#main
26- QUICKSTART_GIT_REF : https://github.com/stellar/quickstart.git#main
2723 # leaving sdk npm version blank defaults to whatever npm has for latest version
2824 # rather than build from git source, which is fine for ci test build
2925 JS_STELLAR_SDK_NPM_VERSION :
30- RS_XDR_GIT_REPO : https://github.com/stellar/rs-stellar-xdr
31- RS_XDR_GIT_REF : main
3226jobs :
3327 complete :
3428 if : always()
3529 needs : [build]
3630 runs-on : ubuntu-latest
3731 steps :
38- - if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
39- run : exit 1
32+ - if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
33+ run : exit 1
4034
4135 build :
4236 runs-on : ubuntu-latest-16-cores
4337 outputs :
4438 push_enabled : ${{ env.PUSH_ENABLED }}
4539 steps :
46- - uses : actions/checkout@v4
47- with :
48- ref : ${{ env.HEAD_SHA }}
49- - name : Build System Test Image
50- run : |
51- make CORE_GIT_REF=${{ env.CORE_GIT_REF }} \
52- CORE_COMPILE_CONFIGURE_FLAGS="${{ env.CORE_COMPILE_CONFIGURE_FLAGS }}" \
53- STELLAR_RPC_GIT_REF=${{ env.STELLAR_RPC_GIT_REF }} \
54- RUST_TOOLCHAIN_VERSION=${{ env.RUST_TOOLCHAIN_VERSION }} \
55- SOROBAN_CLI_GIT_REF=${{ env.SOROBAN_CLI_GIT_REF }} \
56- SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \
57- JS_STELLAR_SDK_NPM_VERSION=${{ env.JS_STELLAR_SDK_NPM_VERSION }} \
58- RS_XDR_GIT_REPO=${{ env.RS_XDR_GIT_REPO }} \
59- RS_XDR_GIT_REF=${{ env.RS_XDR_GIT_REF }} \
60- QUICKSTART_GIT_REF=${{ env.QUICKSTART_GIT_REF }} build;
61- - if : ${{ env.PUSH_ENABLED == 'true' }}
62- name : Save Docker Image to file
63- run : |
64- docker save ${{ env.IMAGE }} -o /tmp/image;
65- - if : ${{ env.PUSH_ENABLED == 'true' }}
66- name : Upload System Test Image
67- uses : actions/upload-artifact@v4
68- with :
69- name : image-Dockerfile
70- path : /tmp/image
40+ - uses : actions/checkout@v4
41+ with :
42+ ref : ${{ env.HEAD_SHA }}
43+ - name : Restore image cache
44+ id : image-cache
45+ uses : actions/cache/restore@v4
46+ with :
47+ path : /tmp/image.tar.zst
48+ key : systemtest-image-${{ runner.os }}-${{ github.sha }}
49+
50+ - name : Load cached Docker image
51+ if : steps.image-cache.outputs.cache-hit == 'true'
52+ run : |
53+ zstd -d -c /tmp/image.tar.zst | docker load
54+
55+ - name : Build System Test Image
56+ if : steps.image-cache.outputs.cache-hit != 'true'
57+ run : |
58+ make SYSTEM_TEST_IMAGE=${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} \
59+ JS_STELLAR_SDK_NPM_VERSION=${{ env.JS_STELLAR_SDK_NPM_VERSION }} \
60+ build;
61+
62+ - name : Save Docker Image to file
63+ if : steps.image-cache.outputs.cache-hit != 'true'
64+ run : |
65+ docker save ${{ env.PUSH_ENABLED == 'true' && env.IMAGE || 'stellar/system-test:dev' }} | zstd -19 -o /tmp/image.tar.zst
66+
67+ - name : Save image cache
68+ if : steps.image-cache.outputs.cache-hit != 'true'
69+ uses : actions/cache/save@v4
70+ with :
71+ path : /tmp/image.tar.zst
72+ key : systemtest-image-${{ runner.os }}-${{ github.sha }}
73+
74+ - if : ${{ env.PUSH_ENABLED == 'true' }}
75+ name : Decompress image for upload
76+ run : |
77+ zstd -d /tmp/image.tar.zst -o /tmp/image.tar
78+
79+ - if : ${{ env.PUSH_ENABLED == 'true' }}
80+ name : Upload System Test Image
81+ uses : actions/upload-artifact@v4
82+ with :
83+ name : image-Dockerfile
84+ path : /tmp/image.tar
7185
7286 push :
7387 # Only push non 'vX.Y.Z' tags as pre-built system test image with versions compiled into image.
@@ -80,16 +94,16 @@ jobs:
8094 runs-on : ubuntu-latest
8195 if : needs.build.outputs.push_enabled == 'true'
8296 steps :
83- - uses : actions/checkout@v4
84- with :
85- ref : ${{ env.HEAD_SHA }}
86- - id : push
87- uses : ./.github/actions/push
88- with :
89- head_sha : ${{ env.HEAD_SHA }}
90- artifact_name : image-Dockerfile
91- artifact_image_file : image
92- image : ${{ env.IMAGE }}
93- registry : ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }}
94- username : ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
95- password : ${{ secrets.DOCKERHUB_TOKEN || github.token }}
97+ - uses : actions/checkout@v4
98+ with :
99+ ref : ${{ env.HEAD_SHA }}
100+ - id : push
101+ uses : ./.github/actions/push
102+ with :
103+ head_sha : ${{ env.HEAD_SHA }}
104+ artifact_name : image-Dockerfile
105+ artifact_image_file : image.tar
106+ image : ${{ env.IMAGE }}
107+ registry : ${{ secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io' }}
108+ username : ${{ secrets.DOCKERHUB_USERNAME || github.actor }}
109+ password : ${{ secrets.DOCKERHUB_TOKEN || github.token }}
0 commit comments