@@ -525,6 +525,29 @@ jobs:
525
525
name : version
526
526
path : ${{ runner.temp }}
527
527
528
+ - name : Configure AWS Credentials
529
+ uses : aws-actions/configure-aws-credentials@v1
530
+ with :
531
+ aws-access-key-id : ${{ secrets.AWS_CACHE_SDK_ACCESS_KEY_ID }}
532
+ aws-secret-access-key : ${{ secrets.AWS_CACHE_SDK_SECRET_ACCESS_KEY }}
533
+ aws-region : us-east-1
534
+
535
+ - name : Download cached source files
536
+ continue-on-error : true
537
+ run : |
538
+ SRC_CACHE_BASE="s3://cache-sdk/crosstool-ng-sources"
539
+ SRC_CACHE_DIR="${{ matrix.host.name }}/${{ matrix.target }}"
540
+ SRC_CACHE_URI="${SRC_CACHE_BASE}/${SRC_CACHE_DIR}"
541
+
542
+ # Download cached source files
543
+ mkdir -p ${WORKSPACE}/sources
544
+ pushd ${WORKSPACE}/sources
545
+ aws s3 sync ${SRC_CACHE_URI} .
546
+ popd
547
+
548
+ # Export environment variables
549
+ echo "SRC_CACHE_URI=${SRC_CACHE_URI}" >> $GITHUB_ENV
550
+
528
551
- name : Build toolchain
529
552
run : |
530
553
# Set output path
@@ -694,6 +717,13 @@ jobs:
694
717
md5sum ${ARCHIVE_FILE} > md5.sum
695
718
sha256sum ${ARCHIVE_FILE} > sha256.sum
696
719
720
+ - name : Sync downloaded source files to cache
721
+ continue-on-error : true
722
+ run : |
723
+ pushd ${WORKSPACE}/sources
724
+ aws s3 sync . ${SRC_CACHE_URI}
725
+ popd
726
+
697
727
- name : Prepare toolchain build log
698
728
if : always()
699
729
run : |
@@ -761,10 +791,37 @@ jobs:
761
791
submodules : recursive
762
792
persist-credentials : false
763
793
794
+ - name : Configure AWS Credentials
795
+ uses : aws-actions/configure-aws-credentials@v1
796
+ with :
797
+ aws-access-key-id : ${{ secrets.AWS_CACHE_SDK_ACCESS_KEY_ID }}
798
+ aws-secret-access-key : ${{ secrets.AWS_CACHE_SDK_SECRET_ACCESS_KEY }}
799
+ aws-region : us-east-1
800
+
801
+ - name : Download cached source files (Linux)
802
+ if : startsWith(matrix.host.name, 'linux-')
803
+ continue-on-error : true
804
+ run : |
805
+ SRC_CACHE_BASE="s3://cache-sdk/poky-sources"
806
+ SRC_CACHE_DIR="${{ matrix.host.name }}"
807
+ SRC_CACHE_URI="${SRC_CACHE_BASE}/${SRC_CACHE_DIR}"
808
+ POKY_DOWNLOADS="${RUNNER_TEMP}/poky-downloads"
809
+
810
+ # Download cached source files
811
+ mkdir -p ${POKY_DOWNLOADS}
812
+ pushd ${POKY_DOWNLOADS}
813
+ aws s3 sync ${SRC_CACHE_URI} .
814
+ popd
815
+
816
+ # Export environment variables
817
+ echo "SRC_CACHE_URI=${SRC_CACHE_URI}" >> $GITHUB_ENV
818
+ echo "POKY_DOWNLOADS=${POKY_DOWNLOADS}" >> $GITHUB_ENV
819
+
764
820
- name : Build Linux host tools
765
821
if : startsWith(matrix.host.name, 'linux-')
766
822
run : |
767
823
POKY_BASE=${GITHUB_WORKSPACE}/meta-zephyr-sdk
824
+ export META_DOWNLOADS="${POKY_DOWNLOADS}"
768
825
769
826
# Check out Poky
770
827
${POKY_BASE}/scripts/meta-zephyr-sdk-clone.sh
@@ -796,6 +853,16 @@ jobs:
796
853
md5sum ${ARCHIVE_FILE} > md5.sum
797
854
sha256sum ${ARCHIVE_FILE} > sha256.sum
798
855
856
+ - name : Sync downloaded source files to cache (Linux)
857
+ if : startsWith(matrix.host.name, 'linux-')
858
+ continue-on-error : true
859
+ run : |
860
+ pushd ${POKY_DOWNLOADS}
861
+ rm -rf git2
862
+ rm -rf svn
863
+ aws s3 sync . ${SRC_CACHE_URI}
864
+ popd
865
+
799
866
- name : Upload toolchain build artifact
800
867
if : startsWith(matrix.host.name, 'linux-') # FIXME: Do for all
801
868
uses : actions/upload-artifact@v2
0 commit comments