mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat(unit-test)!: remove unit-test action (#221)
This commit is contained in:
@@ -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 }}
|
|
||||||
@@ -26,7 +26,6 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain
|
|||||||
|
|
||||||
| Action Name | Description |
|
| 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` |
|
| [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. |
|
| [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. |
|
| [Setup Magento](./setup-magento/README.md) | A Github Action that sets up Magento before `composer install` for an extension or store. |
|
||||||
|
|||||||
@@ -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 }}
|
|
||||||
```
|
|
||||||
@@ -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"
|
|
||||||
Reference in New Issue
Block a user