diff --git a/.github/actions/install-build/action.yml b/.github/actions/install-build/action.yml index eb44cc9105b..77e637177e2 100644 --- a/.github/actions/install-build/action.yml +++ b/.github/actions/install-build/action.yml @@ -1,21 +1,30 @@ name: Install and Build (Composite) description: Installs and builds WooCommerce. +inputs: + working_directory: + required: false + description: The directory to target. + default: ./ runs: using: "composite" steps: - name: Install PNPM shell: bash + working-directory: ${{ inputs.working_directory }} run: npm install -g pnpm@^6.24.2 - name: Install dependencies shell: bash + working-directory: ${{ inputs.working_directory }} run: pnpm install - name: Install Composer dependencies shell: bash + working-directory: ${{ inputs.working_directory }} run: pnpm nx composer-install-no-dev woocommerce - name: Run build shell: bash + working-directory: ${{ inputs.working_directory }} run: pnpm nx build woocommerce diff --git a/.github/workflows/mirrors.yml b/.github/workflows/mirrors.yml index 8c99a9de445..dc1d4e16e01 100644 --- a/.github/workflows/mirrors.yml +++ b/.github/workflows/mirrors.yml @@ -46,7 +46,6 @@ jobs: steps: - name: Create directories run: | - mkdir -p tmp/woocommerce-build mkdir -p monorepo - name: Checkout monorepo diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index 1d3ed8e3eba..bcb6877a493 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -22,9 +22,6 @@ jobs: workflow_name: smoke-test-daily workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - name: Install Jest - run: pnpm install -g jest - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -33,6 +30,9 @@ jobs: - name: Install and Build uses: ./.github/actions/install-build + - name: Install Jest + run: npm install -g jest + - name: Run smoke test. working-directory: plugins/woocommerce env: @@ -91,16 +91,13 @@ jobs: working-directory: plugins/woocommerce run: bash bin/build-zip.sh - - name: Unzip the file (prevents double zip problem) - run: unzip plugins/woocommerce/woocommerce.zip -d zipfile - - name: Upload the zip file as an artifact uses: actions/upload-artifact@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: name: woocommerce - path: zipfile + path: plugins/woocommerce/woocommerce.zip retention-days: 7 test-plugins: @@ -134,7 +131,7 @@ jobs: with: path: package/woocommerce - - uses: ./.github/actions/cache-deps + - uses: ./package/woocommerce/.github/actions/cache-deps with: workflow_name: smoke-test-daily workflow_cache: ${{ secrets.WORKFLOW_CACHE }} @@ -145,8 +142,9 @@ jobs: php-version: '7.4' - name: Install and Build - working-directory: package/woocommerce - uses: ./.github/actions/install-build + uses: ./package/woocommerce/.github/actions/install-build + with: + working_directory: package/woocommerce - name: Download WooCommerce ZIP. uses: actions/download-artifact@v3 @@ -157,8 +155,8 @@ jobs: - name: Extract and replace WooCommerce zip. working-directory: tmp run: | - unzip woocommerce.zip -d woocommerce - rsync -a woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/ + unzip woocommerce.zip -d . + rsync -a woocommerce/* ../package/woocommerce/plugins/woocommerce/ - name: Load docker images and start containers. working-directory: package/woocommerce diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml index ba910b5cc9f..7eb7fa05b9e 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -19,9 +19,6 @@ jobs: workflow_name: smoke-test-release workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - name: Install Jest - run: pnpm install -g jest - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -30,6 +27,9 @@ jobs: - name: Install and Build uses: ./.github/actions/install-build + - name: Install Jest + run: npm install -g jest + - name: Run smoke test. working-directory: plugins/woocommerce env: @@ -70,7 +70,7 @@ jobs: with: path: package/woocommerce - - uses: ./.github/actions/cache-deps + - uses: ./package/woocommerce/.github/actions/cache-deps with: workflow_name: smoke-test-release workflow_cache: ${{ secrets.WORKFLOW_CACHE }} @@ -93,8 +93,9 @@ jobs: php-version: '7.4' - name: Install and Build - working-directory: package/woocommerce - uses: ./.github/actions/install-build + uses: ./package/woocommerce/.github/actions/install-build + with: + working_directory: package/woocommerce - name: Download WooCommerce release zip working-directory: tmp @@ -148,7 +149,7 @@ jobs: with: path: package/woocommerce - - uses: ./.github/actions/cache-deps + - uses: ./package/woocommerce/.github/actions/cache-deps with: workflow_name: smoke-test-release workflow_cache: ${{ secrets.WORKFLOW_CACHE }} @@ -171,8 +172,9 @@ jobs: php-version: '7.4' - name: Install and Build - working-directory: package/woocommerce - uses: ./.github/actions/install-build + uses: ./package/woocommerce/.github/actions/install-build + with: + working_directory: package/woocommerce - name: Download WooCommerce release zip working-directory: tmp