diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 1712a908df..5e8b46b26e 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -39,6 +39,10 @@ on: description: 'OpenSSL branch to test' required: false default: 'fix-tests' + upload_artifacts: + description: 'Upload artifacts' + required: false + default: false workflow_call: inputs: binutils_branch: @@ -53,6 +57,8 @@ on: type: string cocom_branch: type: string + upload_artifacts: + type: boolean outputs: toolchain-package-name: value: ${{ jobs.build-toolchain.outputs.toolchain-package-name }} @@ -124,6 +130,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts || 'false' }} jobs: build-toolchain: @@ -369,7 +376,7 @@ jobs: .github/scripts/toolchain/pack-runtime.sh - name: Upload build folder - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && failure() }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS == 'true' && failure() }} uses: actions/upload-artifact@v4 with: name: ${{ env.BUILD_ARTIFACT_NAME }} @@ -377,7 +384,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload toolchain artifact - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS == 'true' && env.PACK_TOOLCHAIN == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_ARTIFACT_NAME }} @@ -697,6 +704,14 @@ jobs: with: path: ${{ github.workspace }} + - name: Cache OpenSSL tests + id: cache-openssl-tests + uses: actions/cache@v4 + with: + path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-openssl-tests.zip + key: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-openssl-tests + enableCrossOsArchive: true + - name: Checkout OpenSSL uses: actions/checkout@v4 with: @@ -743,6 +758,7 @@ jobs: .github/scripts/openssl/pack-tests.sh - name: Upload artifact + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_NAME }}-openssl @@ -750,6 +766,7 @@ jobs: retention-days: 3 - name: Upload tests artifact + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_NAME }}-openssl-tests @@ -793,6 +810,15 @@ jobs: enableCrossOsArchive: true fail-on-cache-miss: true + - name: Download OpenSSL tests + uses: actions/cache/restore@v4 + with: + path: ${{ env.RELATIVE_ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-openssl-tests.zip + key: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-openssl-tests + restore-keys: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-openssl-tests + enableCrossOsArchive: true + fail-on-cache-miss: true + - name: Download OpenSSL tests uses: actions/download-artifact@v4 with: @@ -942,6 +968,14 @@ jobs: uses: actions/checkout@v4 with: path: ${{ github.workspace }} + + - name: Cache FFmpeg tests + id: cache-ffmpeg-tests + uses: actions/cache@v4 + with: + path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests.zip + key: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-ffmpeg-tests + enableCrossOsArchive: true - name: Checkout FFmpeg uses: actions/checkout@v4 @@ -976,6 +1010,7 @@ jobs: .github/scripts/ffmpeg/pack-tests.sh - name: Upload tests artifact + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests @@ -1025,10 +1060,13 @@ jobs: fail-on-cache-miss: true - name: Download FFmpeg tests - uses: actions/download-artifact@v4 + uses: actions/cache/restore@v4 with: - name: ${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests - path: ${{ env.ARTIFACT_PATH }} + path: ${{ env.RELATIVE_ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests.zip + key: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-ffmpeg-tests + restore-keys: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-ffmpeg-tests + enableCrossOsArchive: true + fail-on-cache-miss: true - name: Unpack ${{ env.TOOLCHAIN_NAME }} runtime run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0ce40a7c1..d389ae22d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,10 @@ on: description: 'Mingw branch to build' required: false default: 'woarm64' + upload_artifacts: + description: 'Upload artifacts' + required: false + default: false env: BINUTILS_BRANCH: ${{ inputs.binutils_branch || 'woarm64' }} GCC_BRANCH: ${{ inputs.gcc_branch || 'woarm64' }} @@ -30,6 +34,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts || 'false' }} jobs: build-toolchain: @@ -67,7 +72,7 @@ jobs: key: main-gcc-ccache-${{ steps.get-cache-key.outputs.timestamp }} - name: Upload build folder - if: failure() + if: ${{ env.UPLOAD_ARTIFACTS == 'true' && failure() }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-build @@ -75,6 +80,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload artifact + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-toolchain