Skip to content

Commit

Permalink
Enhancement: Compile Phar
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Apr 28, 2022
1 parent ce6f948 commit ae78e61
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ make dependency-analysis

to run a dependency analysis.

## Phar

We are using [`humbug/box`](https://github.com/box-project/box) to compile a Phar.

Run

```sh
make phar
```

to compile a Phar.

## Static Code Analysis

We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,35 @@ jobs:
- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

phar:
name: "Phar"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Set up PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with composer"
run: "composer install --ansi --no-progress"

- name: "Compile twigcs.phar with humbug/box"
run: ".phive/box compile"

- name: "Show twigcs.phar version"
run: "php twigcs.phar --version"

static-code-analysis:
name: "Static Code Analysis"

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-
help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: phar
phar: vendor ## Compiles a phar with humbug/box
.phive/box build
php twigcs.phar --version

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
.phive/psalm --config=psalm.xml --clear-cache
Expand Down

0 comments on commit ae78e61

Please sign in to comment.