From f9483db0f8720d607f0a2816d1cc09c5b421e78e Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Sat, 18 Jan 2025 18:16:47 +0100 Subject: [PATCH 1/7] Disable toolchain atrifacts uploading by default --- .github/workflows/advanced.yml | 14 ++++++++++---- .github/workflows/main.yml | 7 ++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 1712a908df..cccc41aba7 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 }} @@ -359,17 +365,17 @@ jobs: key: ccache-${{ steps.cache-keys.outputs.ccache-key }} - name: Pack toolchain - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} run: | .github/scripts/toolchain/pack.sh - name: Pack runtime - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} run: | .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' && upload_artifacts && failure() }} uses: actions/upload-artifact@v4 with: name: ${{ env.BUILD_ARTIFACT_NAME }} @@ -377,7 +383,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' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_ARTIFACT_NAME }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0ce40a7c1..2c848fb76d 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' }} @@ -67,7 +71,7 @@ jobs: key: main-gcc-ccache-${{ steps.get-cache-key.outputs.timestamp }} - name: Upload build folder - if: failure() + if: ${{ failure() && upload_artifacts }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-build @@ -75,6 +79,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload artifact + if: ${{ upload_artifacts }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-toolchain From 6486557f8f36bbd4349d7326ad92b0633885aba1 Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Sat, 18 Jan 2025 18:31:02 +0100 Subject: [PATCH 2/7] Fix env variables --- .github/workflows/advanced.yml | 9 +++++---- .github/workflows/main.yml | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index cccc41aba7..90f2f67e4c 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -130,6 +130,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts }} jobs: build-toolchain: @@ -365,17 +366,17 @@ jobs: key: ccache-${{ steps.cache-keys.outputs.ccache-key }} - name: Pack toolchain - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && env.PACK_TOOLCHAIN == 'true' }} run: | .github/scripts/toolchain/pack.sh - name: Pack runtime - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && env.PACK_TOOLCHAIN == 'true' }} run: | .github/scripts/toolchain/pack-runtime.sh - name: Upload build folder - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && failure() }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && failure() }} uses: actions/upload-artifact@v4 with: name: ${{ env.BUILD_ARTIFACT_NAME }} @@ -383,7 +384,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload toolchain artifact - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && upload_artifacts && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && env.PACK_TOOLCHAIN == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_ARTIFACT_NAME }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c848fb76d..b9f1cc003f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts }} jobs: build-toolchain: @@ -71,7 +72,7 @@ jobs: key: main-gcc-ccache-${{ steps.get-cache-key.outputs.timestamp }} - name: Upload build folder - if: ${{ failure() && upload_artifacts }} + if: ${{ failure() && env.UPLOAD_ARTIFACTS }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-build From c39f72f9561903dad4c157b358e667f2f2366652 Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Sat, 18 Jan 2025 18:36:49 +0100 Subject: [PATCH 3/7] Fix env variables --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9f1cc003f..f95ebe842c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -80,7 +80,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload artifact - if: ${{ upload_artifacts }} + if: ${{ env.UPLOAD_ARTIFACTS }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-toolchain From 033918189c117225f5486cc7aa8f5bd576c3fdfa Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Sat, 18 Jan 2025 21:38:35 +0100 Subject: [PATCH 4/7] Pack toolchain and runtime --- .github/workflows/advanced.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 90f2f67e4c..4a2560a191 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -366,12 +366,12 @@ jobs: key: ccache-${{ steps.cache-keys.outputs.ccache-key }} - name: Pack toolchain - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }} run: | .github/scripts/toolchain/pack.sh - name: Pack runtime - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && env.PACK_TOOLCHAIN == 'true' }} + if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.PACK_TOOLCHAIN == 'true' }} run: | .github/scripts/toolchain/pack-runtime.sh From 79d271bbcd5798d410bc01ab4b19ff20216cef4b Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Sun, 19 Jan 2025 23:24:59 +0100 Subject: [PATCH 5/7] Disable artifacts upload for FFmpeg tests --- .github/workflows/advanced.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 4a2560a191..a840c3531b 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -130,7 +130,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 - UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts }} + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts == 'true' && 1 || 0 }} jobs: build-toolchain: @@ -949,6 +949,14 @@ jobs: uses: actions/checkout@v4 with: path: ${{ github.workspace }} + + - name: Cache toolchain + id: cache-toolchain + 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 @@ -983,6 +991,7 @@ jobs: .github/scripts/ffmpeg/pack-tests.sh - name: Upload tests artifact + if: ${{ env.UPLOAD_ARTIFACTS }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests @@ -1032,10 +1041,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_PACKAGE_NAME }}-ffmpeg-tests.zip + key: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-ffmpeg-tests + restore-keys: ${{ needs.build-toolchain.outputs.runtime-cache-key }}-ffmpeg-tests + enableCrossOsArchive: true + fail-on-cache-miss: true - name: Unpack ${{ env.TOOLCHAIN_NAME }} runtime run: | From ba557d2af35d761257de23185307126749ef2a87 Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Mon, 20 Jan 2025 01:41:21 +0100 Subject: [PATCH 6/7] Fix UPLOAD_ARTIFACTS and FFmpeg, and add OpenSSL tests --- .github/workflows/advanced.yml | 33 ++++++++++++++++++++++++++------- .github/workflows/main.yml | 6 +++--- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index a840c3531b..b622d77aa7 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -130,7 +130,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 - UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts == 'true' && 1 || 0 }} + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts || 'false' }} jobs: build-toolchain: @@ -376,7 +376,7 @@ jobs: .github/scripts/toolchain/pack-runtime.sh - name: Upload build folder - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && 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 }} @@ -384,7 +384,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload toolchain artifact - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && env.UPLOAD_ARTIFACTS && 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 }} @@ -704,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: @@ -750,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 @@ -757,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 @@ -800,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.runtime-cache-key }}-openssl-tests + enableCrossOsArchive: true + fail-on-cache-miss: true + - name: Download OpenSSL tests uses: actions/download-artifact@v4 with: @@ -950,8 +969,8 @@ jobs: with: path: ${{ github.workspace }} - - name: Cache toolchain - id: cache-toolchain + - name: Cache FFmpeg tests + id: cache-ffmpeg-tests uses: actions/cache@v4 with: path: ${{ env.ARTIFACT_PATH }}/${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests.zip @@ -991,7 +1010,7 @@ jobs: .github/scripts/ffmpeg/pack-tests.sh - name: Upload tests artifact - if: ${{ env.UPLOAD_ARTIFACTS }} + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: ${{ env.TOOLCHAIN_NAME }}-ffmpeg-tests @@ -1043,7 +1062,7 @@ jobs: - name: Download FFmpeg tests uses: actions/cache/restore@v4 with: - path: ${{ env.RELATIVE_ARTIFACT_PATH }}/${{ env.TOOLCHAIN_PACKAGE_NAME }}-ffmpeg-tests.zip + 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.runtime-cache-key }}-ffmpeg-tests enableCrossOsArchive: true diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f95ebe842c..d389ae22d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,7 +34,7 @@ env: CCACHE: 1 DELETE_BUILD: 1 - UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts }} + UPLOAD_ARTIFACTS: ${{ inputs.upload_artifacts || 'false' }} jobs: build-toolchain: @@ -72,7 +72,7 @@ jobs: key: main-gcc-ccache-${{ steps.get-cache-key.outputs.timestamp }} - name: Upload build folder - if: ${{ failure() && env.UPLOAD_ARTIFACTS }} + if: ${{ env.UPLOAD_ARTIFACTS == 'true' && failure() }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-build @@ -80,7 +80,7 @@ jobs: path: ${{ env.BUILD_PATH }} - name: Upload artifact - if: ${{ env.UPLOAD_ARTIFACTS }} + if: ${{ env.UPLOAD_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: main-aarch64-w64-mingw32-toolchain From 3879d868388798c11637f35bbf81d5638ab07d24 Mon Sep 17 00:00:00 2001 From: Evgeny Karpov Date: Mon, 20 Jan 2025 03:19:05 +0100 Subject: [PATCH 7/7] Fix cache key name --- .github/workflows/advanced.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index b622d77aa7..5e8b46b26e 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -815,7 +815,7 @@ jobs: 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.runtime-cache-key }}-openssl-tests + restore-keys: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-openssl-tests enableCrossOsArchive: true fail-on-cache-miss: true @@ -1064,7 +1064,7 @@ jobs: with: 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.runtime-cache-key }}-ffmpeg-tests + restore-keys: ${{ needs.build-toolchain.outputs.toolchain-cache-key }}-ffmpeg-tests enableCrossOsArchive: true fail-on-cache-miss: true