diff --git a/.github/workflows/call-universal_test_workflow.yaml b/.github/workflows/call-universal_test_workflow.yaml index ed85c590..00172b3c 100644 --- a/.github/workflows/call-universal_test_workflow.yaml +++ b/.github/workflows/call-universal_test_workflow.yaml @@ -418,6 +418,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' cache_bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -531,6 +532,7 @@ jobs: id: install_module_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: ${{needs.init.outputs.global_title}} @@ -559,6 +561,7 @@ jobs: if: ${{ matrix.testplan != 'skip' }} uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} # yamllint disable-line rule:line-length cached_shop: '${{ steps.install_module_testplan.outputs.install_module_load_shop}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' cache_bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} @@ -763,6 +766,7 @@ jobs: id: phpunit_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -789,6 +793,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpunit_testplan.outputs.phpunit_load_shop}}_${{ steps.phpunit_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpunit_testplan.outputs.phpunit_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -871,6 +876,7 @@ jobs: id: codeception_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -906,6 +912,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.codeception_testplan.outputs.codeception_load_shop}}_${{ steps.codeception_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.codeception_testplan.outputs.codeception_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1010,6 +1017,7 @@ jobs: id: runtest_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1043,6 +1051,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.runtest_testplan.outputs.runtest_load_shop}}_${{ steps.runtest_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.runtest_testplan.outputs.runtest_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1162,6 +1171,7 @@ jobs: id: phpmd_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1188,6 +1198,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpmd_testplan.outputs.phpmd_load_shop}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpmd_testplan.outputs.phpmd_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1283,6 +1294,7 @@ jobs: id: phpstan_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1309,6 +1321,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpstan_testplan.outputs.phpstan_load_shop}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpstan_testplan.outputs.phpstan_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1397,6 +1410,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ needs.init.outputs.install_module_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' cache_bucket: ${{ needs.init.outputs.phpcs_tests_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1471,6 +1485,7 @@ jobs: if: ${{ env.SONAR_TOKEN != '' }} uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1556,6 +1571,7 @@ jobs: id: styles_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1582,6 +1598,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.styles_testplan.outputs.styles_load_shop}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.styles_testplan.outputs.styles_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} diff --git a/.github/workflows/call-universal_test_workflow.yml b/.github/workflows/call-universal_test_workflow.yml index ed85c590..00172b3c 100644 --- a/.github/workflows/call-universal_test_workflow.yml +++ b/.github/workflows/call-universal_test_workflow.yml @@ -418,6 +418,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ needs.init.outputs.prepare_shop_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' cache_bucket: ${{ needs.init.outputs.install_shop_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -531,6 +532,7 @@ jobs: id: install_module_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: ${{needs.init.outputs.global_title}} @@ -559,6 +561,7 @@ jobs: if: ${{ matrix.testplan != 'skip' }} uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} # yamllint disable-line rule:line-length cached_shop: '${{ steps.install_module_testplan.outputs.install_module_load_shop}}_${{steps.install_module_testplan_name.outputs.matrix_suffix}}' cache_bucket: ${{ steps.install_module_testplan.outputs.install_module_cache_bucket }} @@ -763,6 +766,7 @@ jobs: id: phpunit_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -789,6 +793,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpunit_testplan.outputs.phpunit_load_shop}}_${{ steps.phpunit_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpunit_testplan.outputs.phpunit_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -871,6 +876,7 @@ jobs: id: codeception_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -906,6 +912,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.codeception_testplan.outputs.codeception_load_shop}}_${{ steps.codeception_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.codeception_testplan.outputs.codeception_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1010,6 +1017,7 @@ jobs: id: runtest_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1043,6 +1051,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.runtest_testplan.outputs.runtest_load_shop}}_${{ steps.runtest_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.runtest_testplan.outputs.runtest_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1162,6 +1171,7 @@ jobs: id: phpmd_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1188,6 +1198,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpmd_testplan.outputs.phpmd_load_shop}}_${{ steps.phpmd_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpmd_testplan.outputs.phpmd_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1283,6 +1294,7 @@ jobs: id: phpstan_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1309,6 +1321,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.phpstan_testplan.outputs.phpstan_load_shop}}_${{ steps.phpstan_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.phpstan_testplan.outputs.phpstan_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1397,6 +1410,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ needs.init.outputs.install_module_cache_prefix}}_${{needs.init.outputs.global_title}}-PHP${{matrix.php}}-MYSQL${{matrix.mysql}}' cache_bucket: ${{ needs.init.outputs.phpcs_tests_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1471,6 +1485,7 @@ jobs: if: ${{ env.SONAR_TOKEN != '' }} uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1556,6 +1571,7 @@ jobs: id: styles_testplan_name uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1582,6 +1598,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.styles_testplan.outputs.styles_load_shop}}_${{ steps.styles_testplan_name.outputs.matrix_suffix }}' cache_bucket: ${{ steps.styles_testplan.outputs.styles_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} diff --git a/.github/workflows/universal_workflow_light.yaml b/.github/workflows/universal_workflow_light.yaml index 5e6fb6e8..e4c1de23 100644 --- a/.github/workflows/universal_workflow_light.yaml +++ b/.github/workflows/universal_workflow_light.yaml @@ -285,6 +285,7 @@ jobs: id: itn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -736,6 +737,7 @@ jobs: id: rstn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -823,6 +825,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.rt.outputs.runscript_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' cache_bucket: ${{ steps.rt.outputs.runscript_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -940,6 +943,7 @@ jobs: id: rstn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1021,6 +1025,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.rt.outputs.runslim_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' cache_bucket: ${{ steps.rt.outputs.runslim_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1144,6 +1149,7 @@ jobs: if: ${{ env.SONAR_TOKEN != '' }} uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' diff --git a/.github/workflows/universal_workflow_light.yml b/.github/workflows/universal_workflow_light.yml index 5e6fb6e8..e4c1de23 100644 --- a/.github/workflows/universal_workflow_light.yml +++ b/.github/workflows/universal_workflow_light.yml @@ -285,6 +285,7 @@ jobs: id: itn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -736,6 +737,7 @@ jobs: id: rstn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -823,6 +825,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.rt.outputs.runscript_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' cache_bucket: ${{ steps.rt.outputs.runscript_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -940,6 +943,7 @@ jobs: id: rstn uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' @@ -1021,6 +1025,7 @@ jobs: - name: 'Start shop' uses: 'OXID-eSales/github-actions/start_shop@v4' with: + runs_on: ${{ inputs.runs_on }} cached_shop: '${{ steps.rt.outputs.runslim_load_shop}}_${{ steps.rstn.outputs.matrix_suffix }}' cache_bucket: ${{ steps.rt.outputs.runslim_cache_bucket }} cache_endpoint: ${{ secrets.CACHE_ENDPOINT }} @@ -1144,6 +1149,7 @@ jobs: if: ${{ env.SONAR_TOKEN != '' }} uses: OXID-eSales/github-actions/load_cached_testplan@v4 with: + runs_on: ${{ inputs.runs_on }} php: ${{ matrix.php }} mysql: ${{ matrix.mysql }} prefix: '${{ needs.init.outputs.global_title }}' diff --git a/load_cached_testplan/action.yaml b/load_cached_testplan/action.yaml index 0465593f..bbd228ad 100644 --- a/load_cached_testplan/action.yaml +++ b/load_cached_testplan/action.yaml @@ -1,6 +1,10 @@ name: 'load_cached_testplan' description: 'Fetches the testplan and sets environment variables for it' inputs: + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true php: type: string required: false @@ -68,8 +72,9 @@ outputs: runs: using: "composite" steps: - - name: Load cached testplan - id: load_testplan_cache + - name: Load cached testplan from S3 + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + id: load_testplan_cache_s3 uses: tespkg/actions-cache/restore@v1 with: path: | @@ -80,12 +85,19 @@ runs: accessKey: ${{ inputs.cache_access_key }} secretKey: ${{ inputs.cache_secret_key }} bucket: ${{ inputs.cache_bucket }} - + - name: Load cached testplan from Github + if: ${{ inputs.runs_on == '"ubuntu-latest"'}} + id: load_testplan_cache_gh + uses: actions/cache/restore@v4 + with: + path: | + ${{ inputs.plan_folder}}/* + key: ${{ inputs.cache_name }} - name: Confirm successful restore shell: bash run: | # load_cached_testplan: Confirm successful restore - if [ "${{ steps.load_testplan_cache.outputs.cache-hit }}" != "true" ]; then + if [ "${{ steps.load_installed_shop_s3.outputs.cache-hit }}" != "true" && "${{ steps.load_installed_shop_gh.outputs.cache-hit }}" != "true" ]; then echo -e "\033[0;31m### Failed to load ${{ inputs.cache_name }} from cache\033[0m" exit 1 fi diff --git a/start_shop/action.yaml b/start_shop/action.yaml index 36f6f30a..3f5ece40 100644 --- a/start_shop/action.yaml +++ b/start_shop/action.yaml @@ -1,6 +1,10 @@ name: 'start_shop' description: 'Fetches a shop from cache and starts it' inputs: + runs_on: + type: string + description: 'JSON string/array describing the runner' + required: true cached_shop: type: string required: true @@ -59,8 +63,9 @@ inputs: runs: using: "composite" steps: - - name: Load cached shop from cache - id: load_installed_shop + - name: Load cached shop from S3 + if: ${{ inputs.runs_on != '"ubuntu-latest"'}} + id: load_installed_shop_s3 uses: tespkg/actions-cache/restore@v1 with: path: | @@ -73,11 +78,20 @@ runs: secretKey: ${{ inputs.cache_secret_key }} bucket: ${{ inputs.cache_bucket }} + - name: Load cached testplan from Github + if: ${{ inputs.runs_on == '"ubuntu-latest"'}} + id: load_installed_shop_gh + uses: actions/cache/restore@v4 + with: + path: | + ./* + key: ${{ inputs.cached_shop }} + - name: Confirm restore shell: bash run: | # start_shop: Confirm restore - if [ "${{ steps.load_installed_shop.outputs.cache-hit }}" != "true" ]; then + if [ "${{ steps.load_installed_shop_s3.outputs.cache-hit }}" != "true" && "${{ steps.load_installed_shop_gh.outputs.cache-hit }}" != "true" ]; then echo -e "\033[0;31m### Load ${{ inputs.cached_shop }} from cache: FAIL\033[0m" exit 1 else