forked from coenjacobs/mozart
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DIRECTORY_SEPARATOR-and-its-duplicates' into Don't-infe…
…r-vendor-directory-from-package-name.-Fix-for-#97
- Loading branch information
Showing
28 changed files
with
895 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Psalm analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
psalm: | ||
name: Psalm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Psalm | ||
uses: docker://vimeo/psalm-github-actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Publish latest to Docker Hub | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=coenjacobs/mozart | ||
VERSION=latest | ||
TAGS="${DOCKER_IMAGE}:${VERSION}" | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./Dockerfile | ||
target: application | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build, tag and attach releases | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
create-phar: | ||
runs-on: ubuntu-latest | ||
name: Create Mozart phar | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: 7.3 | ||
|
||
- name: Install dependencies | ||
run: composer install --no-dev --prefer-dist --no-suggest --no-progress | ||
|
||
- name: Create .phar | ||
run: | | ||
wget -O phar-composer.phar https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar | ||
mkdir build | ||
mv vendor build/vendor | ||
mv src build/src | ||
mv bin build/bin | ||
mv composer.json build | ||
php -d phar.readonly=off phar-composer.phar build ./build/ | ||
- name: Test run mozart | ||
run: php mozart.phar --version | ||
|
||
- uses: meeDamian/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
files: mozart.phar | ||
gzip: false | ||
allow_override: true | ||
docker: | ||
runs-on: ubuntu-latest | ||
name: Create Docker tag | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=coenjacobs/mozart | ||
VERSION=${{ github.event.release.tag_name }} | ||
TAGS="${DOCKER_IMAGE}:${VERSION}" | ||
echo ::set-output name=tags::${TAGS} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./Dockerfile | ||
target: application | ||
platforms: linux/amd64 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM composer:2.0.8 | ||
|
||
FROM php:8.0.1-cli-alpine AS base | ||
|
||
FROM base as builder | ||
RUN apk update && apk add git | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
COPY ./composer.json /mozart/ | ||
WORKDIR /mozart/ | ||
RUN composer install --no-dev -o | ||
|
||
FROM base AS application | ||
RUN mkdir project | ||
WORKDIR /project/ | ||
COPY --from=builder /mozart/ /mozart/ | ||
COPY ./bin/ /mozart/bin/ | ||
COPY ./src/ /mozart/src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
call_user_func(function ($version) { | ||
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) { | ||
require $autoload; | ||
} elseif (is_file($autoload = getcwd() . '/../../autoload.php')) { | ||
require $autoload; | ||
} | ||
if( ! Phar::running() ) { | ||
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) { | ||
require $autoload; | ||
} elseif (is_file($autoload = getcwd() . '/../../autoload.php')) { | ||
require $autoload; | ||
} | ||
|
||
if (is_file($autoload = __DIR__ . '/../vendor/autoload.php')) { | ||
require($autoload); | ||
} elseif (is_file($autoload = __DIR__ . '/../../../autoload.php')) { | ||
require($autoload); | ||
} else { | ||
fwrite(STDERR, | ||
'You must set up the project dependencies, run the following commands:' . PHP_EOL . | ||
'curl -s http://getcomposer.org/installer | php' . PHP_EOL . | ||
'php composer.phar install' . PHP_EOL | ||
); | ||
exit(1); | ||
if ( is_file( $autoload = __DIR__ . '/../vendor/autoload.php' ) ) { | ||
require( $autoload ); | ||
} elseif ( is_file( $autoload = __DIR__ . '/../../../autoload.php' ) ) { | ||
require( $autoload ); | ||
} else { | ||
fwrite( STDERR, | ||
'You must set up the project dependencies, run the following commands:' . PHP_EOL . | ||
'curl -s http://getcomposer.org/installer | php' . PHP_EOL . | ||
'php composer.phar install' . PHP_EOL | ||
); | ||
exit( 1 ); | ||
} | ||
} else { | ||
include 'phar://mozart.phar/vendor/autoload.php'; | ||
} | ||
|
||
$app = new CoenJacobs\Mozart\Console\Application($version); | ||
$app->run(); | ||
}, '0.6.0'); | ||
}, '0.8.0'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="3" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
interface Autoloader | ||
{ | ||
public function processConfig($autoloadConfig); | ||
public function getSearchNamespace(); | ||
} |
Oops, something went wrong.