diff --git a/.github/actions/cache-deps/action.yml b/.github/actions/cache-deps/action.yml deleted file mode 100644 index 4dab99f8029..00000000000 --- a/.github/actions/cache-deps/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Cache Dependencies (Composite) -description: Creates and restores caches for dependencies. -inputs: - workflow_cache: - required: true - description: The workflow cache key. - workflow_name: - required: true - description: The name of the workflow. - -runs: - using: "composite" - steps: - - name: Dependency caching - uses: actions/cache@v3 - id: cache-deps - with: - path: | - ~/.pnpm-store - ~/.local/share/pnpm/store - ~/.cache/composer/files - key: ${{ runner.os }}-${{ inputs.workflow_name }}-${{ inputs.workflow_cache }}-${{ hashFiles('**/composer.lock', '**/pnpm-lock.yaml') }} diff --git a/.github/actions/install-build/action.yml b/.github/actions/install-build/action.yml deleted file mode 100644 index 5d83de3fc6b..00000000000 --- a/.github/actions/install-build/action.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Install and Build (Composite) -description: Installs and builds WooCommerce. -inputs: - working_directory: - required: false - description: The directory to target. - default: ./ - composer_no_dev: - required: false - description: COMPOSER_NO_DEV option. - default: 1 - -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: COMPOSER_NO_DEV=${{ inputs.composer_no_dev }} pnpm install - - - name: Run build - shell: bash - working-directory: ${{ inputs.working_directory }} - run: pnpm run build --filter="${{ inputs.working_directory }}" --color diff --git a/.github/actions/setup-woocommerce-monorepo/README.md b/.github/actions/setup-woocommerce-monorepo/README.md new file mode 100644 index 00000000000..6f16af8392f --- /dev/null +++ b/.github/actions/setup-woocommerce-monorepo/README.md @@ -0,0 +1,7 @@ +# GitHub Action: Setup WooCommerce Monorepo + +This action will prime the plugins, packages, and tools in the monorepo for other workflows. This includes support for installing dependencies, building projects, and caching the output of both. + +## Usage + +See [`action.yml`](action.yml) for information about all of the inputs the action supports. diff --git a/.github/actions/setup-woocommerce-monorepo/action.yml b/.github/actions/setup-woocommerce-monorepo/action.yml new file mode 100644 index 00000000000..18891eec8f5 --- /dev/null +++ b/.github/actions/setup-woocommerce-monorepo/action.yml @@ -0,0 +1,66 @@ +name: Setup WooCommerce Monorepo +description: Handles the installation, building, and caching of the projects within the monorepo. + +inputs: + install-filters: + description: The PNPM filter used to decide what projects to install. Supports multiline strings for multiple filters. + default: "" + build: + description: Indicates whether or not the action should build any projects. + default: "true" + build-filters: + description: The PNPM filter used to decide what projects to build. Supports multiline strings for multiple filters. + default: "" + php-version: + description: The version of PHP that the action should set up. + default: "7.2" + +runs: + using: composite + steps: + - name: Parse Action Input + id: parse-input + shell: bash + run: | + echo "::set-output name=INSTALL_FILTERS::$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install-filters }}')" + echo "::set-output name=BUILD_FILTERS::$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build-filters }}')" + + - name: Setup PNPM + uses: pnpm/action-setup@10693b3829bf86eb2572aef5f3571dcf5ca9287d + with: + version: 6 + + - name: Setup Node + uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93 + with: + node-version-file: .nvmrc + cache: pnpm + + - name: Setup PHP + uses: shivammathur/setup-php@e04e1d97f0c0481c6e1ba40f8a538454fe5d7709 + with: + php-version: ${{ inputs.php-version }} + coverage: none + + - name: Cache Composer Dependencies + uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 + with: + path: ~/.cache/composer/files + key: ${{ runner.os }}-php-${{ inputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-php-${{ inputs.php-version }}-composer- + + - name: Install Node and PHP Dependencies + shell: bash + run: pnpm install ${{ steps.parse-input.outputs.INSTALL_FILTERS }} + + - name: Cache Build Output + uses: actions/cache@fd5de65bc895cf536527842281bea11763fefd77 + with: + path: node_modules/.cache/turbo + key: ${{ runner.os }}-build-output-${{ hashFiles('node_modules/.cache/turbo/*-meta.json') }} + restore-keys: ${{ runner.os }}-build-output- + + - name: Build + if: ${{ inputs.build == 'true' }} + shell: bash + run: pnpm -w exec turbo run turbo:build ${{ steps.parse-input.outputs.BUILD_FILTERS }} diff --git a/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js b/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js new file mode 100644 index 00000000000..70d7bf583a6 --- /dev/null +++ b/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js @@ -0,0 +1,22 @@ +const args = process.argv.slice(2); +if (args.length != 1) { + console.error('Filters must be passed as a single string!'); + process.exit(-1); +} + +// Read all of the given filters and return the full filter options string. +const filterLines = args[0].split("\n"); +let output = ''; +for (const line of filterLines) { + if (line === '') { + continue; + } + + if (output !== '') { + output += ' '; + } + output += "--filter='" + line + "'"; +} + +console.log(output); +process.exit(0); diff --git a/.github/workflows/build-release-zip-file.yml b/.github/workflows/build-release-zip-file.yml index 1fbb8c762ad..c1cc55eb04d 100644 --- a/.github/workflows/build-release-zip-file.yml +++ b/.github/workflows/build-release-zip-file.yml @@ -13,18 +13,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: build-release-zip-file - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' + build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 4cd9bbe707f..5d3e738794e 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -8,18 +8,11 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: build-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' + build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d263348776..7833fec2442 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,29 +41,16 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: ci - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - tools: composer - extensions: mysql - coverage: none + build-filters: woocommerce - name: Tool versions run: | php --version composer --version - - name: Install and Build - uses: ./.github/actions/install-build - with: - composer_no_dev: 0 - - name: Build Admin feature config run: pnpm build:feature-config --filter=woocommerce diff --git a/.github/workflows/mirrors.yml b/.github/workflows/mirrors.yml index dc1d4e16e01..b3cb91069ee 100644 --- a/.github/workflows/mirrors.yml +++ b/.github/workflows/mirrors.yml @@ -12,18 +12,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: mirrors - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' + build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/nightly-builds.yml b/.github/workflows/nightly-builds.yml index 8ac040d5865..06227ac6615 100644 --- a/.github/workflows/nightly-builds.yml +++ b/.github/workflows/nightly-builds.yml @@ -17,18 +17,10 @@ jobs: with: ref: ${{ matrix.build }} - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: nightly-builds - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' + build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 189f37feacd..8f4a78d5424 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -12,27 +12,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: package-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '16' - registry-url: 'https://registry.npmjs.org' - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Install dependencies - run: pnpm install + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Execute script run: ./tools/package-release/bin/dev publish ${{ github.event.inputs.packages }} --branch=${{ github.ref_name }} --skip-install diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml index b907eed2928..257b67471dc 100644 --- a/.github/workflows/pr-build-and-e2e-tests.yml +++ b/.github/workflows/pr-build-and-e2e-tests.yml @@ -13,18 +13,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-build-and-e2e-tests - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Load docker images and start containers. working-directory: plugins/woocommerce @@ -73,18 +64,9 @@ jobs: API_TEST_REPORT_DIR: ${{ github.workspace }}/api-test-report steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-build-and-e2e-tests - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Load docker images and start containers. working-directory: plugins/woocommerce @@ -113,18 +95,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-build-and-e2e-tests - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Load docker images and start containers. working-directory: plugins/woocommerce diff --git a/.github/workflows/pr-code-coverage.yml b/.github/workflows/pr-code-coverage.yml index 3203475b2b2..61a5b8fe70a 100644 --- a/.github/workflows/pr-code-coverage.yml +++ b/.github/workflows/pr-code-coverage.yml @@ -26,29 +26,16 @@ jobs: with: fetch-depth: 100 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: php-version: 7.4 - tools: composer - extensions: mysql - coverage: none - name: Tool versions run: | php --version composer --version - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-code-coverage - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install and Build - uses: ./.github/actions/install-build - with: - composer_no_dev: 0 - - name: Build Admin feature config run: | pnpm build:feature-config --filter=woocommerce diff --git a/.github/workflows/pr-code-sniff.yml b/.github/workflows/pr-code-sniff.yml index 972f2325f81..638a0b46d7f 100644 --- a/.github/workflows/pr-code-sniff.yml +++ b/.github/workflows/pr-code-sniff.yml @@ -17,27 +17,16 @@ jobs: with: fetch-depth: 0 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - php-version: 7.4 - tools: composer + build: false - name: Tool versions run: | php --version composer --version - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-code-sniff - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install and Build - uses: ./.github/actions/install-build - with: - composer_no_dev: 0 - - name: Run code sniffer uses: thenabeel/action-phpcs@v8 with: diff --git a/.github/workflows/pr-lint-monorepo.yml b/.github/workflows/pr-lint-monorepo.yml index 476c012a2fc..cef42386dcb 100644 --- a/.github/workflows/pr-lint-monorepo.yml +++ b/.github/workflows/pr-lint-monorepo.yml @@ -17,11 +17,10 @@ jobs: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - php-version: '7.4' - tools: composer + build: false - name: Check change files are touched for touched projects env: @@ -29,11 +28,5 @@ jobs: HEAD: ${{ github.event.pull_request.head.sha }} run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD" - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Install dependencies - run: pnpm install - - name: Run changelog validation run: pnpm changelog --filter=* -- validate diff --git a/.github/workflows/pr-lint-test-js.yml b/.github/workflows/pr-lint-test-js.yml index 34316ecd378..4430cc0d023 100644 --- a/.github/workflows/pr-lint-test-js.yml +++ b/.github/workflows/pr-lint-test-js.yml @@ -12,22 +12,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-node@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - node-version: '16' - - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-lint-test-js - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + install-filters: 'woocommerce/client/admin...' - name: Lint run: pnpm run lint --filter='woocommerce/client/admin...' --filter='!@woocommerce/e2e*' --filter='!@woocommerce/api' --color diff --git a/.github/workflows/pr-smoke-test.yml b/.github/workflows/pr-smoke-test.yml index 2df47ddb60e..45e6077c0cf 100644 --- a/.github/workflows/pr-smoke-test.yml +++ b/.github/workflows/pr-smoke-test.yml @@ -17,22 +17,12 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-smoke-test - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Install Jest run: pnpm install -g jest - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build - - name: Run smoke test. working-directory: plugins/woocommerce if: always() diff --git a/.github/workflows/pr-unit-tests.yml b/.github/workflows/pr-unit-tests.yml index d0fb5bbeb80..6a3c7fe718b 100644 --- a/.github/workflows/pr-unit-tests.yml +++ b/.github/workflows/pr-unit-tests.yml @@ -37,33 +37,16 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: pr-unit-tests - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: php-version: ${{ matrix.php }} - tools: composer - extensions: mysql - coverage: none - name: Tool versions run: | php --version composer --version - - name: Install and Build - uses: ./.github/actions/install-build - with: - composer_no_dev: 0 - - - name: Build Admin feature config - run: | - pnpm build:feature-config --filter=woocommerce - - name: Add PHP8 Compatibility. run: | if [ "$(php -r "echo version_compare(PHP_VERSION,'8.0','>=');")" ]; then diff --git a/.github/workflows/prepare-package-release.yml b/.github/workflows/prepare-package-release.yml index 29036fdf452..9ba5e668979 100644 --- a/.github/workflows/prepare-package-release.yml +++ b/.github/workflows/prepare-package-release.yml @@ -12,21 +12,9 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: prepare-package-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Install dependencies - run: pnpm install + + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Execute script run: ./tools/package-release/bin/dev prepare ${{ github.event.inputs.packages }} diff --git a/.github/workflows/prime-cache.yml b/.github/workflows/prime-cache.yml index f977dfb54be..90a260a6f26 100644 --- a/.github/workflows/prime-cache.yml +++ b/.github/workflows/prime-cache.yml @@ -13,17 +13,8 @@ jobs: prime: name: Prime cache runs-on: ubuntu-20.04 - strategy: - fail-fast: true - matrix: - workflow: [ 'pr-unit-tests', 'pr-build-and-e2e-tests', 'pr-code-coverage', 'pr-code-sniff', 'pr-lint-test-js', 'pr-smoke-test' ] steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps - with: - workflow_name: ${{ matrix.workflow }} - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install and Build - uses: ./.github/actions/install-build + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo diff --git a/.github/workflows/release-changelog.yml b/.github/workflows/release-changelog.yml index 6237a10cc87..2fbd879a048 100644 --- a/.github/workflows/release-changelog.yml +++ b/.github/workflows/release-changelog.yml @@ -24,14 +24,10 @@ jobs: with: fetch-depth: 0 - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: "Install PHP" - uses: shivammathur/setup-php@v2 + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - php-version: '7.4' - tools: composer + build: false - name: "Git fetch the release branch" run: git fetch origin ${{ inputs.releaseBranch }} @@ -42,9 +38,6 @@ jobs: - name: "Create a new branch for the changelog update PR" run: git checkout -b ${{ format( 'update/{0}-changelog', inputs.releaseVersion ) }} - - name: Install dependencies - run: pnpm install - - name: "Generate the changelog file" run: pnpm changelog --filter=woocommerce -- write --add-pr-num -n -vvv --use-version ${{ inputs.releaseVersion }} diff --git a/.github/workflows/release-code-freeze.yml b/.github/workflows/release-code-freeze.yml index 939322b8df7..d23a87afeeb 100644 --- a/.github/workflows/release-code-freeze.yml +++ b/.github/workflows/release-code-freeze.yml @@ -65,22 +65,10 @@ jobs: with: fetch-depth: 100 - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: release-code-freeze - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: "Install PHP" - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - tools: composer - - - name: Install dependencies - run: pnpm install + build: false - name: "Run the script to enforce the code freeze" id: freeze diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index 3e881bbced6..41f1c07e371 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -17,18 +17,8 @@ jobs: with: ref: trunk - - uses: ./.github/actions/cache-deps - with: - workflow_name: smoke-test-daily - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo - name: Install Jest run: npm install -g jest @@ -130,18 +120,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: smoke-test-daily - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Install PNPM - run: npm install -g pnpm@^6.24.2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' + build: false - name: Build zip working-directory: plugins/woocommerce @@ -187,21 +169,6 @@ jobs: with: path: package/woocommerce - - uses: ./package/woocommerce/.github/actions/cache-deps - with: - workflow_name: smoke-test-daily - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./package/woocommerce/.github/actions/install-build - with: - working_directory: package/woocommerce - - name: Download WooCommerce ZIP. uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml index d8a2921dab5..f202b3467de 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -14,18 +14,10 @@ jobs: with: ref: trunk - - uses: ./.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: smoke-test-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./.github/actions/install-build + build-filters: woocommerce - name: Install Jest run: npm install -g jest @@ -70,10 +62,10 @@ jobs: with: path: package/woocommerce - - uses: ./package/woocommerce/.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: smoke-test-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} + build-filters: woocommerce - name: Fetch Asset ID id: fetch_asset_id @@ -87,16 +79,6 @@ jobs: const script = require( './package/woocommerce/.github/workflows/scripts/fetch-asset-id.js' ) await script({github, context, core}) - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./package/woocommerce/.github/actions/install-build - with: - working_directory: package/woocommerce - - name: Download WooCommerce release zip working-directory: tmp run: | @@ -149,10 +131,10 @@ jobs: with: path: package/woocommerce - - uses: ./package/woocommerce/.github/actions/cache-deps + - name: Setup WooCommerce Monorepo + uses: ./.github/actions/setup-woocommerce-monorepo with: - workflow_name: smoke-test-release - workflow_cache: ${{ secrets.WORKFLOW_CACHE }} + build-filters: woocommerce - name: Fetch Asset ID id: fetch_asset_id @@ -166,16 +148,6 @@ jobs: const script = require( './package/woocommerce/.github/workflows/scripts/fetch-asset-id.js' ) await script({github, context, core}) - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - - name: Install and Build - uses: ./package/woocommerce/.github/actions/install-build - with: - working_directory: package/woocommerce - - name: Download WooCommerce release zip working-directory: tmp run: | diff --git a/turbo.json b/turbo.json index 5130766698b..a43c31b740a 100644 --- a/turbo.json +++ b/turbo.json @@ -73,15 +73,8 @@ }, "turbo:test": { + "cache": false, "dependsOn": [ "turbo:build" ], - "inputs": [ - "src/**/*.js", - "src/**/*.jsx", - "src/**/*.ts", - "src/**/*.tsx", - "src/**/*.php", - "includes/**/*.php" - ], "outputs": [] } }