From 984dda3efaf12366a5d6cc81feedc0b6b87265b2 Mon Sep 17 00:00:00 2001 From: Damien Retzinger Date: Sat, 25 Jun 2022 21:36:58 -0400 Subject: [PATCH] docs: document unit, integration, and installation (#4) --- .github/workflows/integration-README.md | 31 ++++++++++ .github/workflows/unit.yaml | 2 +- README.md | 26 +++++++++ installation-test/README.md | 75 +++++++++++++++++++++++++ unit-test/README.md | 36 ++++++++++++ 5 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/integration-README.md create mode 100644 README.md create mode 100644 installation-test/README.md create mode 100644 unit-test/README.md diff --git a/.github/workflows/integration-README.md b/.github/workflows/integration-README.md new file mode 100644 index 0000000..8a3d608 --- /dev/null +++ b/.github/workflows/integration-README.md @@ -0,0 +1,31 @@ +# Integration Tests for a Magento Package + +A Github Workflow that runs the Integration Tests of a Magento Package + +## Inputs + +See the [integration.yaml](./integration.yaml) + +## Usage + +```yml +name: Integration Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + integration-workflow: + uses: graycoreio/github-actions-magento2/.github/workflows/integration.yaml@main + with: + package_name: YOUR_PACKAGE_NAME + source_folder: $GITHUB_WORKSPACE + test_command: ../../../vendor/bin/phpunit ../../../vendor/YOUR_VENDOR/YOUR_PACKAGE_NAME/Test/Integration + secrets: + composer_auth: ${{ secrets.COMPOSER_AUTH }} +``` diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index f0d3cd1..e149715 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -15,7 +15,7 @@ on: - README.md jobs: - install-test: + unit-test: strategy: matrix: php_version: diff --git a/README.md b/README.md new file mode 100644 index 0000000..455a6b2 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# Magento 2 GitHub Actions + +Opinionated Github Actions and Workflows to make building, testing, and maintaining Magento 2 Modules easier. + +* [README if you are new to Github Actions.](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#the-components-of-github-actions) +* [What is a workflow?](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#workflows) +* [What is an action?](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#actions) + +## Workflows + +| Workflow Name | Description | +| -------------------------------------------------------- | ---------------------------------------------------------------------- | +| [Integration Test](./.github/workflows/integration-README.md) | A Github Workflow that runs the Integration Tests of a Magento Package | + +## Actions + +| Action Name | Description | +| ------------------------------------------------ | ------------------------------------------------------------------ | +| [Unit Test](./unit-test/README.md) | A Github Action that runs the Unit Tests a Magento Package | +| [Installation Test](installation-test/README.md) | A Github Action that tests the installability of a Magento Package | + +### Action or Workflow? + +If you're just getting started with your Magento package on Github, you probably want to use the workflows. + +If you're looking to customize further, or you need to support a broader range of Magento versions, then you probably want an action. diff --git a/installation-test/README.md b/installation-test/README.md new file mode 100644 index 0000000..350ef56 --- /dev/null +++ b/installation-test/README.md @@ -0,0 +1,75 @@ +# Deploy Angular Universal to Vercel GitHub Actions + +A Github Action that tests the installability of a Magento Package + +## Inputs + +See the [action.yml](./action.yml) + +## Usage + +```yml +name: Installation Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + install-test: + strategy: + matrix: + magento: + - magento/project-community-edition:>=2.3 <2.4 + - magento/project-community-edition:>=2.4.0 <2.4.1 + - magento/project-community-edition:>=2.4.1 <2.4.2 + - magento/project-community-edition:>=2.4.2 <2.4.3 + - magento/project-community-edition:>=2.4.3 <2.4.4 + - magento/project-community-edition:>=2.4.4 <2.4.5 + - magento/project-community-edition + include: + + - magento: magento/project-community-edition:>=2.3 <2.4 + php_version: 7.4 + composer_version: 1 + + - magento: magento/project-community-edition:>=2.4.0 <2.4.1 + php_version: 7.4 + composer_version: 1 + + - magento: magento/project-community-edition:>=2.4.1 <2.4.2 + php_version: 7.4 + composer_version: 1 + + - magento: magento/project-community-edition:>=2.4.2 <2.4.3 + php_version: 7.4 + composer_version: 2 + + - magento: magento/project-community-edition:>=2.4.3 <2.4.4 + php_version: 7.4 + composer_version: 2 + + - magento: magento/project-community-edition:>=2.4.4 <2.4.5 + php_version: 8.1 + composer_version: 2 + + - magento: magento/project-community-edition + composer_version: 2 + php_version: 8.1 + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: graycoreio/github-actions-magento2/installation-test@main + with: + composer_version: ${{ matrix.composer_version }} + php_version: ${{ matrix.php_version }} + magento_version: ${{ matrix.magento }} + composer_auth: ${{ secrets.COMPOSER_AUTH }} + package_name: YOUR_PACKAGE_NAME + source_folder: $GITHUB_WORKSPACE +``` diff --git a/unit-test/README.md b/unit-test/README.md new file mode 100644 index 0000000..081cc97 --- /dev/null +++ b/unit-test/README.md @@ -0,0 +1,36 @@ +# Deploy Angular Universal to Vercel GitHub Actions + +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@v2 + - uses: graycoreio/github-actions-magento2/unit-test@main + with: + php_version: ${{ matrix.php_version }} + composer_auth: ${{ secrets.COMPOSER_AUTH }} +```