You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-2
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,63 @@ jobs:
23
23
24
24
steps:
25
25
- uses: actions/checkout@v1
26
-
- uses: phpactions/composer@master
26
+
- uses: php-actions/composer@v1
27
27
# ... then your own project steps ...
28
28
```
29
29
30
+
Running custom commands
31
+
-----------------------
32
+
33
+
By default, adding `- uses: php-actions/composer@v1` into your workflow will run `composer install`, as `install` is the default command name.
34
+
35
+
You can issue custom commands by passing a `command` input, like so:
36
+
37
+
```yaml
38
+
...
39
+
40
+
jobs:
41
+
build:
42
+
43
+
...
44
+
45
+
- name: Install dependencies
46
+
uses: php-actions/composer@v1
47
+
with:
48
+
command: your-command-here
49
+
```
50
+
51
+
Caching dependencies for faster builds
52
+
--------------------------------------
53
+
54
+
Github actions supports dependency caching, allowing the `vendor/` directory contents to be cached between workflows, as long as the `composer.lock` file has not changed. This produces much faster builds, as the `composer install` command does not have to be run at all if the cache is valid.
55
+
56
+
Example workflow (taken from https://github.com/PhpGt/Dom):
In the example above, the "key" is passed to the Cache action that consists of a hash of the composer.lock file. This means that as long as the contents of composer.lock doesn't change between workflows, the vendor directory will be persisted between workflows.
0 commit comments