Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 0 additions & 95 deletions .github/workflows/update_version.yml

This file was deleted.

5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ ENV COMPOSER_HOME=/composer

RUN echo "memory_limit=-1" > $PHP_INI_DIR/conf.d/memory-limit.ini

ENV VERSION=0.7.0
# Default version - can be overridden via action input
ENV DEFAULT_VERSION=*

RUN composer global require phparkitect/phparkitect $VERSION \
RUN composer global require phparkitect/phparkitect ${DEFAULT_VERSION} \
&& composer global require phpunit/phpunit \
&& composer global show "*phparkitect*"

Expand Down
75 changes: 65 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,30 @@

This repository is created for run PHPArkitect into Github Actions

## ⚠️ Migration from v0.x

If you're currently using the old Docker image format:
```yaml
uses: docker://phparkitect/arkitect-github-actions:0.7.0
```

Please update to the new format for better flexibility and automatic updates:
```yaml
uses: phparkitect/arkitect-github-actions@main
with:
phparkitect-version: '0.7.0' # optional, defaults to latest
```

**Benefits of migrating:**
- Choose any PHPArkitect version without waiting for action releases
- Get automatic updates when using default version
- Support for version constraints (e.g., `^0.7`, `*`)

## Usage
You can use it as a Github Action like this:

```yaml
# .github/workflows/test.yml
# .github/workflows/test.yml

on:
push:
Expand All @@ -27,24 +46,60 @@ jobs:
uses: actions/checkout@v2

- name: PHPArkitect
uses: docker://phparkitect/arkitect-github-actions
uses: phparkitect/arkitect-github-actions@main
with:
args: check
```

_to use a specific php version:_
```diff
uses: docker://phparkitect/arkitect-github-actions
+ env:
+ PHP_VERSION: 8.0
### Configuration Options

#### Specify PHPArkitect version
You can specify which version of PHPArkitect to use:

```yaml
- name: PHPArkitect
uses: phparkitect/arkitect-github-actions@main
with:
phparkitect-version: '0.7.0' # specific version
args: check
```

## Building and pushing the docker image
Or use version constraints:
```yaml
phparkitect-version: '^0.7' # latest 0.7.x
phparkitect-version: '*' # latest stable (default)
```

#### Specify PHP version
To use a specific PHP version for platform requirements check:

```yaml
- name: PHPArkitect
uses: phparkitect/arkitect-github-actions@main
env:
PHP_VERSION: 8.0
with:
args: check
```
docker login

## Development

### How it works
The GitHub Action now builds the Docker image locally for each workflow run. This allows users to specify which version of PHPArkitect they want to use without requiring a new release of this action for every PHPArkitect update.

### Building the docker image locally
If you want to build and test the image locally:

```bash
docker build -t phparkitect/arkitect-github-actions:latest .
docker push phparkitect/arkitect-github-actions:latest
docker run --rm phparkitect/arkitect-github-actions:latest --version
```

### Release Strategy
Releases of this GitHub Action are only needed when:
- The action configuration changes (action.yml)
- The entrypoint script changes (entrypoint.sh)
- The Dockerfile structure changes
- New features are added to the action itself

**No release is needed** for PHPArkitect version updates, as users can specify their desired version via the `phparkitect-version` input.
8 changes: 7 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ description: "Use Arkitect via GithubAction."

name: "phparkitect-arkitect"

inputs:
phparkitect-version:
description: "PHPArkitect version to use (e.g., 0.7.0, ^0.7, *). Defaults to latest stable version."
required: false
default: "*"

runs:
using: "docker"
image: "docker://phparkitect/arkitect-github-actions:0.7.0"
image: "Dockerfile"
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

set -e

# Handle custom PHPArkitect version if specified
if [ -n "$INPUT_PHPARKITECT_VERSION" ]; then
echo "::group::Installing PHPArkitect version $INPUT_PHPARKITECT_VERSION"
composer global require phparkitect/phparkitect "$INPUT_PHPARKITECT_VERSION"
echo "::endgroup::"
fi

/composer/vendor/bin/phparkitect --version

IGNORE_PLATFORM_REQS=""
Expand Down