-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Add composite action for installing dependencies with phive
- Loading branch information
1 parent
713f0c2
commit 28c070b
Showing
4 changed files
with
112 additions
and
0 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
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ This repository provides the following composite actions: | |
- [`ergebnis/.github/actions/oh-dear/check/request-run`](#oh-dear-check-request-run) | ||
- [`ergebnis/.github/actions/oh-dear/maintenance-period/start`](#oh-dear-maintenance-period-start) | ||
- [`ergebnis/.github/actions/oh-dear/maintenance-period/stop`](#oh-dear-maintenance-period-stop) | ||
- [`ergebnis/.github/actions/phive/install`](#phive-install) | ||
|
||
### <a name="composer-determine-cache-directory"> `ergebnis/.github/actions/composer/determine-cache-directory` | ||
|
||
|
@@ -655,6 +656,63 @@ none | |
|
||
A maintenance period is stopped by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the site identified by the `oh-dear-site-id` input. | ||
|
||
### <a name="phive-install"> `ergebnis/.github/actions/phive/install` | ||
|
||
This action installs dependencies with [`phive`](https://phar.io). | ||
|
||
```yaml | ||
name: "Integrate" | ||
on: | ||
pull_request: null | ||
push: | ||
branches: | ||
- "main" | ||
jobs: | ||
tests: | ||
name: "Tests" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
- name: "Set up PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
coverage: "none" | ||
php-version: "8.1" | ||
tools: "phive" | ||
- name: "Install dependencies with phive" | ||
uses: "ergebnis/.github/actions/phive/[email protected]" | ||
with: | ||
trust-gpg-keys: "0x033E5F8D801A2F8D,0x2A8299CE842DD38C" | ||
``` | ||
|
||
For details, see [`actions/phive/install/action.yaml`](actions/phive/install/action.yaml). | ||
|
||
#### Inputs | ||
|
||
- `phive-home`, optional: Which directory to use as `PHIVE_HOME` directory, defaults to `".build/phive"`. | ||
- `trust-gpg-keys`, required: Which GPG keys to trust, a comma-separated list of trusted GPG keys | ||
|
||
#### Outputs | ||
|
||
none | ||
|
||
#### Side Effects | ||
|
||
Dependencies are installed, assuming | ||
|
||
- `phive` is available | ||
- `phive` could find a `phars.xml` | ||
- keys presented by packages are listed using the `trust-gpg-keys` option | ||
|
||
The directory configured by the `phive-home` directory is cached using [`actions/cache`](https://github.com/actions/cache). | ||
|
||
## Changelog | ||
|
||
Please have a look at [`CHANGELOG.md`](CHANGELOG.md). | ||
|
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,39 @@ | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action | ||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs | ||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions | ||
# https://phar.io | ||
|
||
name: "Install dependencies with phive" | ||
|
||
description: "Installs dependencies with phive" | ||
|
||
inputs: | ||
phive-home: | ||
default: ".build/phive" | ||
description: "Which directory to use as PHIVE_HOME directory" | ||
required: false | ||
trust-gpg-keys: | ||
default: "" | ||
description: "A comma-separated list of trusted GPG keys" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: "Create phive home directory" | ||
run: "mkdir -p ${{ inputs.phive-home }}" | ||
shell: "bash" | ||
|
||
- name: "Cache dependencies installed with phive" | ||
uses: "actions/[email protected]" | ||
with: | ||
path: "${{ inputs.phive-home }}" | ||
key: "phive-hashFiles('**/phars.xml')" | ||
restore-keys: "phive-" | ||
|
||
- name: "Install dependencies with phive" | ||
env: | ||
PHIVE_HOME: "${{ inputs.phive-home }}" | ||
run: "phive install --trust-gpg-keys ${{ inputs.trust-gpg-keys }}" | ||
shell: "bash" |