diff --git a/.github/workflows/_internal-unit.yaml b/.github/workflows/_internal-unit.yaml deleted file mode 100644 index 8fc18ef..0000000 --- a/.github/workflows/_internal-unit.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Unit Test - -on: - push: - branches: - - main - paths: - - "_test/demo-package/**" - - ".github/workflows/_internal-unit.yaml" - - "unit-test/**" - - "!(**/*.md)" - pull_request: - branches: - - main - paths: - - "_test/demo-package/**" - - ".github/workflows/_internal-unit.yaml" - - "unit-test/**" - - "!(**/*.md)" - -jobs: - unit-test: - strategy: - matrix: - php_version: - - 8.2 - - 8.3 - - 8.4 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: ./unit-test - with: - source_folder: _test/demo-package - php_version: ${{ matrix.php_version }} diff --git a/README.md b/README.md index ffc3712..6684db4 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,6 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain | Action Name | Description | | ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | -| [Unit Test](./unit-test/README.md) | A Github Action that runs the Unit Tests a Magento Package | | [Fix Magento Install](./fix-magento-install/README.md) | A Github Action that fixes Magento before `composer install` | | [Cache Magento](./cache-magento/README.md) | A Github Action that creates a composer cache for a Magento extension or store. | | [Setup Magento](./setup-magento/README.md) | A Github Action that sets up Magento before `composer install` for an extension or store. | diff --git a/unit-test/README.md b/unit-test/README.md deleted file mode 100644 index d1bd375..0000000 --- a/unit-test/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Magento 2 Unit Test Action - -A Github Action that runs the Unit Tests of a Magento Package - -## Inputs - -See the [action.yml](./action.yml) - -## Usage - -```yml -name: Unit Test - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - unit-test: - strategy: - matrix: - php_version: - - 7.4 - - 8.1 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: graycoreio/github-actions-magento2/unit-test@main - with: - php_version: ${{ matrix.php_version }} - composer_auth: ${{ secrets.COMPOSER_AUTH }} -``` diff --git a/unit-test/action.yml b/unit-test/action.yml deleted file mode 100644 index ffef656..0000000 --- a/unit-test/action.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: "Unit Test" -author: "Graycore" -description: "A Github Action that runs the Unit Tests of a Magento Package" -inputs: - php_version: - required: true - default: "8.4" - description: "PHP Version to use" - - source_folder: - required: true - default: . - description: "The source folder of the package" - - test_command: - required: true - default: composer run test - description: "The test command" - - composer_auth: - required: false - description: "Composer Authentication Credentials" - -runs: - using: "composite" - steps: - - name: Set PHP Version - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ inputs.php_version }} - - - name: Get Composer Cache Directory - shell: bash - working-directory: ${{ inputs.source_folder }} - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache Composer Packages" - uses: actions/cache@v5 - with: - key: "composer | v4 | ${{ hashFiles('composer.lock') }} | ${{ runner.os }} | ${{ inputs.php_version }}" - path: ${{ steps.composer-cache.outputs.dir }} - - - run: composer install - name: Require and attempt install - working-directory: ${{ inputs.source_folder }} - shell: bash - env: - COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }} - COMPOSER_AUTH: ${{ inputs.composer_auth }} - - - run: ${{ inputs.test_command }} - name: Run Unit Tests - working-directory: ${{ inputs.source_folder }} - shell: bash - env: - COMPOSER_CACHE_DIR: ${{ steps.composer-cache.outputs.dir }} - COMPOSER_AUTH: ${{ inputs.composer_auth }} - -branding: - icon: "code" - color: "green"