Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test automatic phar creation process #223

Merged
merged 3 commits into from
Nov 27, 2020
Merged
Changes from 2 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
66 changes: 66 additions & 0 deletions .github/workflows/phar-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Building Require-Checker phar"

on:
pull_request:
push:
branches:
- "master"
DanielBadura marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
name: "Building Require-Checker phar"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "7.4"
operating-system:
- "ubuntu-latest"

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
tools: "phing"
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1, phar.readonly=0

- name: "Cache dependencies"
uses: "actions/cache@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "build via phing"
run: "phing"

- name: "Upload phar file artifact"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this runs on: [pull_request, branch], where is this artifact to be found? Just attached to builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the phar is available and attached to the build, for this PR it would be here: https://github.com/maglnet/ComposerRequireChecker/actions/runs/368166959

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, but not really a stable distribution channel.

If this is only for testing, it should be fine 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes only for testing new features / bugfixes as a phar.
And as a nice on top: It's testing the phar building process itself - since it the phar now getting build for every PR :)

uses: actions/upload-artifact@v2
with:
name: composer-require-checker.phar
path: build/composer-require-checker.phar