Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
983892b3c3 | ||
|
|
d07beb70e1 | ||
|
|
2a3920f0a8 | ||
|
|
f87f989186 | ||
|
|
1dee067adc | ||
|
|
a35414e37a | ||
|
|
5787967c1f | ||
|
|
872187355a | ||
|
|
7b56e4491e | ||
|
|
acc1fdb337 | ||
|
|
e3286d1234 | ||
|
|
83019fade2 | ||
|
|
83b3d4a8f9 | ||
|
|
56273e234f | ||
|
|
48a00b4d3f | ||
|
|
f641885a8d | ||
|
|
9457ce6e2b | ||
|
|
a31f8b1a2b | ||
|
|
ffded4a3e8 | ||
|
|
9e6b9d7d70 | ||
|
|
7d45057bba | ||
|
|
c4fd8b0739 | ||
|
|
49088ede98 | ||
|
|
3543ed1ef8 | ||
|
|
9bd0fdbc18 | ||
|
|
c5d29cf8e3 | ||
|
|
c5e0997b44 | ||
|
|
ee084d3176 | ||
|
|
c256f0c9cb | ||
|
|
d84365cd03 | ||
|
|
3c52e818b1 | ||
|
|
188598ef9d | ||
|
|
f8b8d766d5 | ||
|
|
15a6402865 | ||
|
|
91bd6b26c2 | ||
|
|
9dae796baf | ||
|
|
6d9aef83a3 | ||
|
|
bd5a0d94b6 | ||
|
|
5405f14867 | ||
|
|
cb25b9c13a | ||
|
|
e63d25d41f | ||
|
|
2a7ae24c8e | ||
|
|
e68a74a71c | ||
|
|
67152eb712 | ||
|
|
83bdf158fa | ||
|
|
5e240ab99f | ||
|
|
0fae072f07 | ||
|
|
e0561697dc | ||
|
|
3aa0f17b55 | ||
|
|
8b218279a3 | ||
|
|
90b6355bf0 | ||
|
|
84f23853b7 | ||
|
|
a4001afbd6 | ||
|
|
cfbb105cb6 | ||
|
|
c549015370 | ||
|
|
9e22b87414 | ||
|
|
7961bc11b1 | ||
|
|
87f807365d | ||
|
|
25d9bbc737 | ||
|
|
d2f865c91a | ||
|
|
a13373a271 | ||
|
|
a764546381 | ||
|
|
380b68048b | ||
|
|
4dcf9cd2ab | ||
|
|
f3641e0c33 | ||
|
|
d35633ec7a | ||
|
|
7eea3d82f6 | ||
|
|
57ecdba082 | ||
|
|
db03758c66 | ||
|
|
82837572d4 | ||
|
|
8efcf46b31 | ||
|
|
4391cf8a4c | ||
|
|
87a69f94d9 | ||
|
|
c12fad850b | ||
|
|
47b8d68850 | ||
|
|
530929f741 | ||
|
|
a965723128 | ||
|
|
9845a63f5c | ||
|
|
4af7e96d03 | ||
|
|
13a3d9d0a9 | ||
|
|
9d042b2683 | ||
|
|
7a59874419 | ||
|
|
8dee767b82 | ||
|
|
5fc5a95363 | ||
|
|
8ba779d78e | ||
|
|
04376074d2 | ||
|
|
262202d43f | ||
|
|
f64dddeeb4 | ||
|
|
1d50c4a8cd | ||
|
|
d313593fee | ||
|
|
5753a00ef5 | ||
|
|
38731c6386 | ||
|
|
9f400a0dfd | ||
|
|
ba020e3463 | ||
|
|
c0d425d939 | ||
|
|
4752a51595 | ||
|
|
10608f5908 | ||
|
|
d01ec214f2 | ||
|
|
6158538131 | ||
|
|
dd27d4eb81 | ||
|
|
248d04f73c | ||
|
|
c5e40d9067 | ||
|
|
e0ed1ad0ef | ||
|
|
2907f8a584 | ||
|
|
52691651dc | ||
|
|
b9404683e1 | ||
|
|
70954fb6f8 | ||
|
|
65e65163cd | ||
|
|
41397ce45e | ||
|
|
c09954033f | ||
|
|
7cec1987ac | ||
|
|
739e40fb5e | ||
|
|
9dec5892e7 | ||
|
|
94616818f0 | ||
|
|
4f0d9003dc | ||
|
|
b2edfc47dd | ||
|
|
6bd872ad2c | ||
|
|
03eb8cc744 | ||
|
|
9687dd1d8a | ||
|
|
2df0d2b443 | ||
|
|
0e56c0b653 | ||
|
|
0469a6f681 | ||
|
|
325413a824 | ||
|
|
b84dd3ce25 | ||
|
|
190220c10d | ||
|
|
4fb049a68b | ||
|
|
3e0678b50f | ||
|
|
5b06192e7c | ||
|
|
b419442896 | ||
|
|
49b8b7e301 | ||
|
|
b1776b79c8 | ||
|
|
a48ff666f8 | ||
|
|
3bffbad95a | ||
|
|
18041fdab5 | ||
|
|
b36d2222e6 | ||
|
|
50ffa593bb | ||
|
|
6cbc46fdb6 | ||
|
|
08c60fceea | ||
|
|
c30a9630bb | ||
|
|
0158fe2782 | ||
|
|
3a8557bcc6 | ||
|
|
d10d1e249b | ||
|
|
3ec1728de8 | ||
|
|
9c266d4158 | ||
|
|
0135ee2ed1 | ||
|
|
5c2618165a | ||
|
|
8123132b99 | ||
|
|
f5863fd356 | ||
|
|
cf0fdf35f2 | ||
|
|
8830cdd08c | ||
|
|
4960e3179f | ||
|
|
0f3f604249 | ||
|
|
5915f05b06 | ||
|
|
dccdb5ab67 | ||
|
|
9a01fd28ca | ||
|
|
d5cd6a4bd1 | ||
|
|
006301e81d | ||
|
|
4a38014043 | ||
|
|
a0ac655b06 | ||
|
|
41e56c42c7 | ||
|
|
4e8a0cfe8b | ||
|
|
ee72f2f8ad | ||
|
|
ed557fd2c3 | ||
|
|
d90cd153ee | ||
|
|
3376371dd8 | ||
|
|
a2b261d79a | ||
|
|
6c93dbd391 | ||
|
|
f58dc6eca1 | ||
|
|
5326f2302f | ||
|
|
b9a78a31fb | ||
|
|
ba69b25cab | ||
|
|
a6533acdd4 | ||
|
|
d3b37e3d0d | ||
|
|
f3a1262ff6 | ||
|
|
933abd531a | ||
|
|
67ed7f234b | ||
|
|
f90accffb3 | ||
|
|
93441b70bf | ||
|
|
67f23b6380 | ||
|
|
2937ad6e7a | ||
|
|
a5e5d07fcb | ||
|
|
30d8b321f4 | ||
|
|
405e57e429 | ||
|
|
58f376b118 | ||
|
|
b7d68d8225 | ||
|
|
9252820289 | ||
|
|
a5cc9fab25 | ||
|
|
4e5685a75d | ||
|
|
d475227ba5 | ||
|
|
38cb8b924d | ||
|
|
fdd83e94df | ||
|
|
ad112b7981 | ||
|
|
2b0d6e221f | ||
|
|
acee5b203f | ||
|
|
84e88e382f | ||
|
|
bbdc4e3b67 | ||
|
|
311eb9f3ba | ||
|
|
3dfd7a648b | ||
|
|
943f491830 | ||
|
|
dc9461a053 | ||
|
|
f2720d7b82 | ||
|
|
99161b7790 | ||
|
|
5de6285e1f | ||
|
|
14d702e830 | ||
|
|
9539b27b4a | ||
|
|
a4f7326577 | ||
|
|
9b297384e1 | ||
|
|
9d77946f60 | ||
|
|
6d21e6dc05 | ||
|
|
68c827cfcf | ||
|
|
d95ca49e8d | ||
|
|
03fd0b8719 | ||
|
|
ebe1c12c21 | ||
|
|
b46021d870 | ||
|
|
64ba54fc1b | ||
|
|
71571f685a | ||
|
|
10f86cb1a1 | ||
|
|
0f694c5087 | ||
|
|
9dfebd1adb | ||
|
|
3781acab4b | ||
|
|
cdfbf6d0f0 | ||
|
|
0ccb02802f | ||
|
|
a4572586dc | ||
|
|
cb3c752d1f | ||
|
|
383a511d0e | ||
|
|
cc55dbcaa8 | ||
|
|
e644692ccf | ||
|
|
96d5358317 | ||
|
|
3a473c9a22 | ||
|
|
40944de129 | ||
|
|
f9202d6b64 | ||
|
|
d99c8732ba | ||
|
|
2c559eae3d | ||
|
|
3a2ca44a8a | ||
|
|
17241e2689 | ||
|
|
ca33d01e9f | ||
|
|
3c6644f237 | ||
|
|
326dfd1e76 | ||
|
|
d9cf6f5ad6 | ||
|
|
ea50c7c0a2 | ||
|
|
6ca549dcaa | ||
|
|
d3760be2cc | ||
|
|
3454287b87 | ||
|
|
88c7757dc8 | ||
|
|
48cfea3f3e | ||
|
|
43cfa2b1a8 | ||
|
|
76cecacc5e | ||
|
|
d6e173ffc6 | ||
|
|
26701f2ec8 | ||
|
|
e934fe28b8 | ||
|
|
d384d9fe7e | ||
|
|
4eeaf5f99e | ||
|
|
fd2392db56 | ||
|
|
494dde7189 | ||
|
|
706dfca1e6 | ||
|
|
d613c975f6 | ||
|
|
fbe1419ce4 | ||
|
|
c844c7b6e4 | ||
|
|
8e5cc09df9 | ||
|
|
f4f8aec1f2 | ||
|
|
b44b7344e0 | ||
|
|
e01b2f0bf7 | ||
|
|
f7f8ecb931 | ||
|
|
4f0d810cbc | ||
|
|
47335179aa | ||
|
|
63c4aea452 | ||
|
|
898b6fa1f9 | ||
|
|
747c8838bc | ||
|
|
9d6b61c5af | ||
|
|
5108c81610 | ||
|
|
e58c704985 | ||
|
|
e9c783eef0 | ||
|
|
b44e5e009f | ||
|
|
8489dbf4de | ||
|
|
f23ae2e6f7 | ||
|
|
d2b233e45f | ||
|
|
320474a245 | ||
|
|
65ccfb36dc | ||
|
|
88fb99b592 | ||
|
|
9e7bc5c91f | ||
|
|
ca2f547a35 | ||
|
|
9f21c80d24 | ||
|
|
c4317135df | ||
|
|
a2dd688679 | ||
|
|
bd214a2dca | ||
|
|
2ee4653d1c | ||
|
|
0b3e0f451d | ||
|
|
0bfa897634 | ||
|
|
71db1e2cf1 | ||
|
|
16d1cd4766 | ||
|
|
1193cd100b | ||
|
|
e839a77d8c | ||
|
|
552df3f2b0 | ||
|
|
3109c941eb | ||
|
|
aa8706a5bf | ||
|
|
9afdee42e8 | ||
|
|
aa0e9403d8 | ||
|
|
5b00f068f3 | ||
|
|
8f39d3eddd | ||
|
|
9d87d1fd14 | ||
|
|
07ae2343d0 | ||
|
|
7b8bf7af6a | ||
|
|
0ac6f76d36 | ||
|
|
6c6203b683 | ||
|
|
0c9f8a8e7e | ||
|
|
1705daea72 | ||
|
|
58fbc33c3a | ||
|
|
3f42b7d5fb | ||
|
|
dd4f0db7bf | ||
|
|
7d026bfa6b | ||
|
|
6a70f864ec | ||
|
|
8e1cde2d0a | ||
|
|
de32d8b95f | ||
|
|
273096b82f | ||
|
|
4c045616f4 | ||
|
|
935e74fb40 | ||
|
|
a507be73b5 | ||
|
|
673dcaff6d | ||
|
|
2cbfd4fb41 | ||
|
|
0969980399 | ||
|
|
1fa2905bc6 | ||
|
|
790a48c30d | ||
|
|
4b69160eff | ||
|
|
7f805f22af | ||
|
|
f2972dcf18 | ||
|
|
2d488f53fd | ||
|
|
421187c870 | ||
|
|
1798f4d615 | ||
|
|
8039546df3 | ||
|
|
c6ad3d1a70 | ||
|
|
922f1e27b8 | ||
|
|
2d3750b36e | ||
|
|
51c7527bd8 | ||
|
|
2bf7ab0207 | ||
|
|
b3a84fc51e | ||
|
|
1330950cd5 | ||
|
|
afb57fca4e | ||
|
|
50344f4883 | ||
|
|
2b027bd9bc | ||
|
|
8f8207a1ca | ||
|
|
87e6c70743 | ||
|
|
e3d18718a9 | ||
|
|
cfa7bc51cd | ||
|
|
ade633f0da | ||
|
|
2cabcf2941 | ||
|
|
9ce4bd6f1b | ||
|
|
190ae49ac1 | ||
|
|
032bc86056 | ||
|
|
704c5180a4 | ||
|
|
e4fc767f9c | ||
|
|
1cf6a369bb | ||
|
|
14acb26bdc | ||
|
|
3ff7f9cedc | ||
|
|
98e937751c | ||
|
|
31b338b199 | ||
|
|
9e32964a24 | ||
|
|
4dcf2b117f | ||
|
|
6d8250310d | ||
|
|
3164116a42 | ||
|
|
747d45cb52 | ||
|
|
4b7ad1ca81 | ||
|
|
31ef16e586 | ||
|
|
dd1def7620 | ||
|
|
693a73d8da | ||
|
|
965eb91efd | ||
|
|
db9f610623 | ||
|
|
24fb306a50 | ||
|
|
919fe77b43 | ||
|
|
914c51cfb6 | ||
|
|
8d8c2bd524 | ||
|
|
7ef437ee9d | ||
|
|
0871fbb11b | ||
|
|
3039a720ed | ||
|
|
7f32ab318e | ||
|
|
ddcacf4760 | ||
|
|
2f951ef5cd | ||
|
|
5a081357b4 | ||
|
|
c4a64dff61 | ||
|
|
aad33a8e35 | ||
|
|
eae890b1b2 | ||
|
|
8fbd2ea6bb | ||
|
|
46161660dc | ||
|
|
de68427afb | ||
|
|
4ba36c5432 | ||
|
|
99e2d8d309 | ||
|
|
929f9cd52d | ||
|
|
4dba50d3af | ||
|
|
1c258f399f | ||
|
|
e05bc317ec | ||
|
|
44815f1f73 | ||
|
|
22f5ad47d2 | ||
|
|
a29956826a | ||
|
|
c11d023c03 | ||
|
|
cade5f7157 | ||
|
|
7964656607 | ||
|
|
970e2d5ebb | ||
|
|
5b09e1195e | ||
|
|
6fdecd40be | ||
|
|
159a09794e | ||
|
|
0be846de83 | ||
|
|
981c662f5d | ||
|
|
71c631cffb | ||
|
|
47387dd6e9 | ||
|
|
fec9df11d6 | ||
|
|
03f36220f4 | ||
|
|
1db0b0651d | ||
|
|
3f6c88dec7 | ||
|
|
2b938d931a | ||
|
|
71bd88f604 | ||
|
|
242082a22f | ||
|
|
b9db11a072 | ||
|
|
f381d2384c | ||
|
|
63d8fa1a9e | ||
|
|
dd1c34be39 | ||
|
|
1eb8e8f5cd | ||
|
|
0000679cbb | ||
|
|
7c5f2ab8e9 | ||
|
|
9d5e8ddc70 | ||
|
|
77bc79bd22 | ||
|
|
02c5ec11cc | ||
|
|
d2e09be6ce | ||
|
|
013ddc75a3 | ||
|
|
25abc4c776 | ||
|
|
4000f65b59 | ||
|
|
e14155415a | ||
|
|
9f16995a6f | ||
|
|
24ecbee4ea | ||
|
|
c71102b8a0 | ||
|
|
0815f5a8bb | ||
|
|
e5076cee70 | ||
|
|
bd85a2a227 | ||
|
|
976fb6996a | ||
|
|
06e916db9d | ||
|
|
46ac6f2211 | ||
|
|
47d1da0476 | ||
|
|
dfabf8ce29 | ||
|
|
9304663cff | ||
|
|
878561f9a8 | ||
|
|
9550c7aa45 | ||
|
|
ebeb82f894 | ||
|
|
aa2af38672 | ||
|
|
d27b4a7bc7 | ||
|
|
aeb5831c32 | ||
|
|
cb5e07baff | ||
|
|
9469267fb3 | ||
|
|
1d6dab3cd1 | ||
|
|
20d1b1c6f1 | ||
|
|
0d8d5d2f2c | ||
|
|
16267e1982 | ||
|
|
91d14c7068 | ||
|
|
340ab0b95f | ||
|
|
75c0e130e8 | ||
|
|
57a0907a18 | ||
|
|
3315fa09dc | ||
|
|
b132b4eb7c | ||
|
|
9145972d5c | ||
|
|
0ac43c03b2 | ||
|
|
46f009cce1 | ||
|
|
8d9a12ba84 | ||
|
|
76e0150bb5 | ||
|
|
ffc5b0249d | ||
|
|
a6aaa1db78 | ||
|
|
62beed29e3 | ||
|
|
fce9311522 | ||
|
|
b2e7a49dd5 | ||
|
|
99bbaa2a58 | ||
|
|
f7f5b1a7e1 | ||
|
|
e755fb7a69 | ||
|
|
3087ceb811 | ||
|
|
05e2b0d1e9 | ||
|
|
dd5c977988 | ||
|
|
c1c0acc338 | ||
|
|
409e055931 | ||
|
|
46a875ad7e | ||
|
|
7e81c058fb | ||
|
|
754ab9515b | ||
|
|
f866c880c2 | ||
|
|
eb21cb8fb3 | ||
|
|
aee6b953c3 | ||
|
|
21c3c8db47 | ||
|
|
c0e0d9d98e | ||
|
|
5ab8ec4a99 | ||
|
|
ec3c220bb2 | ||
|
|
17d90ace86 | ||
|
|
ba5306eea9 | ||
|
|
06929bdf4c | ||
|
|
e97e822eff | ||
|
|
0f97f445fb | ||
|
|
507cc5e95d | ||
|
|
2a30f9d208 | ||
|
|
eaf140ca8b | ||
|
|
dcd432d918 | ||
|
|
91a03a2865 | ||
|
|
ca33947c62 | ||
|
|
932b66f3fc | ||
|
|
651d2619bb | ||
|
|
16f13a69eb | ||
|
|
9134867822 | ||
|
|
36104f0983 | ||
|
|
a0b0e58cb3 | ||
|
|
c6f956927a | ||
|
|
83cc9a4bcf | ||
|
|
e63fd8e122 | ||
|
|
d33e2e06e4 | ||
|
|
7fcf39f8e9 | ||
|
|
43a64813f3 | ||
|
|
ba83ab2e67 | ||
|
|
9cfe4e665e | ||
|
|
585f7a1fd2 | ||
|
|
43178a7254 | ||
|
|
db44db4b97 | ||
|
|
601f50f55e | ||
|
|
e71c06a64f | ||
|
|
c5825452ec | ||
|
|
339c69c9a5 | ||
|
|
e4a37d0f16 | ||
|
|
a398f54da4 | ||
|
|
69f9b777e1 | ||
|
|
02867faba4 | ||
|
|
35b0788556 | ||
|
|
2484a27666 | ||
|
|
42de8649eb | ||
|
|
f6674883c6 | ||
|
|
738fa3dfee | ||
|
|
9616296853 | ||
|
|
b45c80e26a | ||
|
|
764f8c8453 | ||
|
|
c5513d9a78 | ||
|
|
1c6748567c | ||
|
|
76bcc07458 | ||
|
|
8ba904fa24 | ||
|
|
13824286db | ||
|
|
e5083c779b | ||
|
|
2f94ea1a79 |
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"env": { "node": true, "jest": true },
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:import/errors",
|
||||||
|
"plugin:import/warnings",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
|
"prettier/@typescript-eslint"
|
||||||
|
],
|
||||||
|
"plugins": ["@typescript-eslint", "jest"]
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to making participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||||
|
level of experience, education, socio-economic status, nationality, personal
|
||||||
|
appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at contact@shivammathur.com. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see
|
||||||
|
https://www.contributor-covenant.org/faq
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
# Contributing to setup-php
|
||||||
|
|
||||||
|
## Contributor Code of Conduct
|
||||||
|
|
||||||
|
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||||
|
|
||||||
|
## Workflow
|
||||||
|
|
||||||
|
* Fork the project.
|
||||||
|
* Make your bug fix or feature addition.
|
||||||
|
* Add tests for it. This is important so we don't break it in a future version unintentionally.
|
||||||
|
* If editing the scripts, create a demo integration test.
|
||||||
|
* Send a pull request to the develop branch with all the details.
|
||||||
|
|
||||||
|
Please make sure that you have [set up your user name and email address](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name <root@localhost>` look really stupid in the commit history of a project.
|
||||||
|
|
||||||
|
Due to time constraints, you may not always get a quick response. Please do not take delays personally and feel free to remind.
|
||||||
|
|
||||||
|
## Coding Guidelines
|
||||||
|
|
||||||
|
This project comes with `.prettierrc.json` and `eslintrc.json` configuration files. Please run the following commands to format the code before committing it.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run format
|
||||||
|
$ npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
## Using setup-php from a Git checkout
|
||||||
|
|
||||||
|
The following commands can be used to perform the initial checkout of setup-php:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git clone https://github.com/shivammathur/setup-php.git
|
||||||
|
|
||||||
|
$ cd setup-php
|
||||||
|
```
|
||||||
|
|
||||||
|
Install setup-php dependencies using [npm](https://www.npmjs.com/):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running the test suite
|
||||||
|
|
||||||
|
After following the steps shown above, The `setup-php` tests in the `__tests__` directory can be run using this command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
## Creating a release
|
||||||
|
|
||||||
|
Create a release before you push your changes.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run release
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reporting issues
|
||||||
|
|
||||||
|
Please submit the issue using the appropriate template provided for a bug report or a feature request:
|
||||||
|
|
||||||
|
* [Issues](https://github.com/shivammathur/setup-php/issues)
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
open_collective: setup-php
|
||||||
|
tidelift: "npm/setup-php"
|
||||||
|
community_bridge: setup-php
|
||||||
|
patreon: shivammathur
|
||||||
|
custom: https://www.paypal.me/shivammathur
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Nice, you found a bug!
|
||||||
|
title: ''
|
||||||
|
labels: 'bug'
|
||||||
|
assignees: 'shivammathur'
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
<!-- Please describe the bug concisely. -->
|
||||||
|
|
||||||
|
**Version**
|
||||||
|
- [ ] I have checked releases and the bug exists in the latest patch version of `v1` or `v2`.
|
||||||
|
- [ ] `v2`
|
||||||
|
- [ ] `v1`
|
||||||
|
|
||||||
|
**Runners**
|
||||||
|
<!-- Please mark the GitHub Action runner your workflow uses. -->
|
||||||
|
- [ ] GitHub Hosted
|
||||||
|
- [ ] Self Hosted
|
||||||
|
|
||||||
|
**Operating systems**
|
||||||
|
<!-- Please mention the operating systems your workflow uses. -->
|
||||||
|
|
||||||
|
**PHP versions**
|
||||||
|
<!-- Please mention the PHP versions your workflow uses. -->
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
<!-- Please provide the relevant steps of your workflow `.yml` file. -->
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
|
**Screenshots/Logs**
|
||||||
|
<!-- If applicable, add screenshots or logs to help explain your problem. -->
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|
||||||
|
**Are you willing to submit a PR?**
|
||||||
|
<!-- We accept pull requests targeting the develop branch. -->
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest a new feature
|
||||||
|
title: ''
|
||||||
|
labels: 'enhancement'
|
||||||
|
assignees: 'shivammathur'
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the feature**
|
||||||
|
<!-- Please describe concisely the feature you want to add. -->
|
||||||
|
|
||||||
|
**Version**
|
||||||
|
- [ ] I have checked releases and the feature is missing in the latest patch version of `v2`.
|
||||||
|
|
||||||
|
**Underlying issue**
|
||||||
|
<!-- Please describe the issue this would solve. -->
|
||||||
|
|
||||||
|
**Describe alternatives**
|
||||||
|
<!-- Please mention any alternative solutions you've considered. -->
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
<!-- Add any other context or screenshots about the feature request here. -->
|
||||||
|
|
||||||
|
**Are you willing to submit a PR?**
|
||||||
|
<!-- We accept pull requests targeting the develop branch. -->
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
---
|
||||||
|
name: 🐞 Bug Fix, ⚙ Improvement or 🎉 New Feature
|
||||||
|
about: You found a bug, want to improve something or add a new feature
|
||||||
|
labels: bug or enhancement
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## A Pull Request should be associated with an Issue.
|
||||||
|
|
||||||
|
> If you're fixing a bug, adding a new feature or improving something please provide the details in Issues,
|
||||||
|
> so that the development can be pointed in the intended direction.
|
||||||
|
|
||||||
|
Related issue: <!-- Please link the related issue -->
|
||||||
|
|
||||||
|
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
|
||||||
|
> Thank you for your contribution.
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
|
This PR [briefly explain what it does]
|
||||||
|
|
||||||
|
> In case this PR introduced TypeScript/JavaScript code changes:
|
||||||
|
|
||||||
|
- [ ] I have written test cases for the changes in this pull request
|
||||||
|
- [ ] I have run `npm run format` before the commit.
|
||||||
|
- [ ] I have run `npm run lint` before the commit.
|
||||||
|
- [ ] I have run `npm run release` before the commit.
|
||||||
|
- [ ] `npm test` returns with no unit test errors and all code covered.
|
||||||
|
|
||||||
|
> In case this PR edits any scripts:
|
||||||
|
|
||||||
|
- [ ] I have checked the edited scripts for syntax.
|
||||||
|
- [ ] I have tested the changes in an integration test (If yes, provide workflow link).
|
||||||
|
|
||||||
|
<!--
|
||||||
|
- Please target the develop branch when submitting the pull request.
|
||||||
|
-->
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
The following versions of this project are supported for security updates.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 1.9.x | :white_check_mark: |
|
||||||
|
| 2.5.x | :white_check_mark: |
|
||||||
|
|
||||||
|
## Supported PHP Versions
|
||||||
|
|
||||||
|
This security policy only applies to the latest patches of the following PHP versions.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 7.2 | :white_check_mark: |
|
||||||
|
| 7.3 | :white_check_mark: |
|
||||||
|
| 7.4 | :white_check_mark: |
|
||||||
|
| 8.0 | :white_check_mark: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@shivammathur.com](mailto:contact@shivammathur.com).
|
||||||
|
Do not report security reports publicly.
|
||||||
|
|
||||||
|
## Tidelift
|
||||||
|
|
||||||
|
If you use this GitHub Action through a Tidelift subscription, please refer to [https://tidelift.com/security](https://tidelift.com/security).
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
name: Node workflow
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- verbose
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'examples/**'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- verbose
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'examples/**'
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
name: Run
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js 12.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Prettier Format Check
|
||||||
|
run: npm run format-check
|
||||||
|
|
||||||
|
- name: ESLint Check
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
- name: Send Coverage
|
||||||
|
continue-on-error: true
|
||||||
|
timeout-minutes: 1
|
||||||
|
run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}
|
||||||
@@ -1,27 +1,78 @@
|
|||||||
name: Main workflow
|
name: Main workflow
|
||||||
on: [push]
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- verbose
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'examples/**'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
- verbose
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- 'examples/**'
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 15
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest]
|
||||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
|
||||||
|
env:
|
||||||
|
extensions: xml, opcache, xdebug, pcov
|
||||||
|
key: cache-v3
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set Node.js 10.x
|
- name: Setup cache environment
|
||||||
uses: actions/setup-node@master
|
id: extcache
|
||||||
with:
|
uses: shivammathur/cache-extensions@develop
|
||||||
version: 10.x
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: ${{ env.extensions }}
|
||||||
|
key: ${{ env.key }}
|
||||||
|
|
||||||
- name: Installing NPM
|
- name: Cache extensions
|
||||||
run: npm install
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.extcache.outputs.dir }}
|
||||||
|
key: ${{ steps.extcache.outputs.key }}
|
||||||
|
restore-keys: ${{ steps.extcache.outputs.key }}
|
||||||
|
|
||||||
- name: Installing PHP
|
- name: Setup PHP with extensions and custom config
|
||||||
run: node lib/install.js
|
run: node dist/index.js
|
||||||
env:
|
env:
|
||||||
php-version: ${{ matrix.php-versions }}
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: ${{ env.extensions }}
|
||||||
|
ini-values: post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata
|
||||||
|
|
||||||
|
- name: Testing PHP version
|
||||||
|
run: |
|
||||||
|
php -v
|
||||||
|
php -r "if(strpos(phpversion(), '${{ matrix.php-versions }}') === false) {throw new Exception('Wrong PHP version Installed');}"
|
||||||
|
|
||||||
|
- name: Testing Composer version
|
||||||
|
run: |
|
||||||
|
composer -V
|
||||||
|
php -r "if(strpos(@exec('composer -V'), 'Composer version') === false) {throw new Exception('Composer not found');}"
|
||||||
|
- name: Testing Extensions
|
||||||
|
run: |
|
||||||
|
php -m
|
||||||
|
php -r "if(! extension_loaded('xml')) {throw new Exception('xml not found');}"
|
||||||
|
php -r "if(! extension_loaded('Xdebug')) {throw new Exception('Xdebug not found');}"
|
||||||
|
php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}"
|
||||||
|
- name: Testing ini values
|
||||||
|
run: |
|
||||||
|
php -r "if(ini_get('memory_limit')!='-1') {throw new Exception('memory_limit not disabled');}"
|
||||||
|
php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}"
|
||||||
|
php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}"
|
||||||
|
php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}"
|
||||||
+93
@@ -0,0 +1,93 @@
|
|||||||
|
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
|
||||||
|
node_modules/
|
||||||
|
__tests__/runner/*
|
||||||
|
lib/
|
||||||
|
|
||||||
|
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# TypeScript v1 declaration files
|
||||||
|
typings/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
.env.test
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# next.js build output
|
||||||
|
.next
|
||||||
|
|
||||||
|
# nuxt.js build output
|
||||||
|
.nuxt
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
.dynamodb/
|
||||||
+7
-6
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"bracketSpacing": false,
|
||||||
|
"endOfLine": "auto",
|
||||||
|
"parser": "typescript",
|
||||||
"printWidth": 80,
|
"printWidth": 80,
|
||||||
"tabWidth": 2,
|
|
||||||
"useTabs": false,
|
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
|
"tabWidth": 2,
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"bracketSpacing": false,
|
"useTabs": false
|
||||||
"arrowParens": "avoid",
|
}
|
||||||
"parser": "typescript"
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2019 shivammathur and contributors
|
Copyright (c) 2019-2020 shivammathur and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,69 +1,705 @@
|
|||||||
# setup-php
|
<p align="center">
|
||||||
|
<a href="https://github.com/marketplace/actions/setup-php-action" target="_blank">
|
||||||
<p align="left">
|
<img src="https://repository-images.githubusercontent.com/206578964/e0a18480-dc65-11e9-8dd3-b9ffbf5575fe" alt="Setup PHP in GitHub Actions" width="400">
|
||||||
<a href="https://github.com/shivammathur/setup-php"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
This action sets up a php environment along with composer on multiple platforms for use in github actions.
|
<h1 align="center">Setup PHP in GitHub Actions</h1>
|
||||||
|
|
||||||
# PHP Version Support
|
<p align="center">
|
||||||
- 5.6
|
<a href="https://github.com/shivammathur/setup-php" title="GitHub action to setup PHP"><img alt="GitHub Actions status" src="https://github.com/shivammathur/setup-php/workflows/Main%20workflow/badge.svg"></a>
|
||||||
- 7.0
|
<a href="https://codecov.io/gh/shivammathur/setup-php" title="Code coverage"><img alt="Codecov Code Coverage" src="https://codecov.io/gh/shivammathur/setup-php/branch/master/graph/badge.svg"></a>
|
||||||
- 7.1
|
<a href="https://github.com/shivammathur/setup-php/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
|
||||||
- 7.2
|
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.0-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
|
||||||
- 7.3
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://reddit.com/r/setup_php" title="setup-php reddit"><img alt="setup-php reddit" src="https://img.shields.io/badge/reddit-join-FF5700?logo=reddit&logoColor=FF5700&labelColor=555555"></a>
|
||||||
|
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
|
||||||
|
<a href="https://setup-php.statuspage.io/" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
# Operating Systems Support
|
Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross platform interface to setup the PHP environment you need to test your application. Refer to [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
|
||||||
- Linux (ubuntu-latest)
|
|
||||||
- Windows (windows-latest)
|
|
||||||
- MacOS (macOS-latest)
|
|
||||||
|
|
||||||
# Usage
|
## Contents
|
||||||
|
|
||||||
See [action.yml](action.yml)
|
- [PHP Support](#tada-php-support)
|
||||||
|
- [OS/Platform Support](#cloud-osplatform-support)
|
||||||
|
- [GitHub-Hosted Runners](#github-hosted-runners)
|
||||||
|
- [Self-Hosted Runners](#self-hosted-runners)
|
||||||
|
- [PHP Extension Support](#heavy_plus_sign-php-extension-support)
|
||||||
|
- [Tools Support](#wrench-tools-support)
|
||||||
|
- [Coverage Support](#signal_strength-coverage-support)
|
||||||
|
- [Xdebug](#xdebug)
|
||||||
|
- [PCOV](#pcov)
|
||||||
|
- [Disable Coverage](#disable-coverage)
|
||||||
|
- [Usage](#memo-usage)
|
||||||
|
- [Inputs](#inputs)
|
||||||
|
- [Basic Setup](#basic-setup)
|
||||||
|
- [Matrix Setup](#matrix-setup)
|
||||||
|
- [Nightly Build Setup](#nightly-build-setup)
|
||||||
|
- [Self Hosted Setup](#self-hosted-setup)
|
||||||
|
- [Local Testing Setup](#local-testing-setup)
|
||||||
|
- [Thread Safe Setup](#thread-safe-setup)
|
||||||
|
- [Force Update](#force-update)
|
||||||
|
- [Verbose Setup](#verbose-setup)
|
||||||
|
- [Cache Extensions](#cache-extensions)
|
||||||
|
- [Cache Composer Dependencies](#cache-composer-dependencies)
|
||||||
|
- [Cache Node.js Dependencies](#cache-nodejs-dependencies)
|
||||||
|
- [Composer GitHub OAuth](#composer-github-oauth)
|
||||||
|
- [Problem Matchers](#problem-matchers)
|
||||||
|
- [Examples](#examples)
|
||||||
|
- [Versioning](#bookmark-versioning)
|
||||||
|
- [License](#scroll-license)
|
||||||
|
- [Contributions](#1-contributions)
|
||||||
|
- [Support This Project](#sparkling_heart-support-this-project)
|
||||||
|
- [Dependencies](#package-dependencies)
|
||||||
|
- [Further Reading](#bookmark_tabs-further-reading)
|
||||||
|
|
||||||
|
## :tada: PHP Support
|
||||||
|
|
||||||
|
|PHP Version|Stability|Release Support|Runner Support|
|
||||||
|
|--- |--- |--- |--- |
|
||||||
|
|`5.3`|`Stable`|`End of life`|`GitHub-hosted`|
|
||||||
|
|`5.4`|`Stable`|`End of life`|`GitHub-hosted`|
|
||||||
|
|`5.5`|`Stable`|`End of life`|`GitHub-hosted`|
|
||||||
|
|`5.6`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`7.0`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`7.1`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`7.2`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`7.3`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|`8.0`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`|
|
||||||
|
|
||||||
|
**Note:** Specifying `8.0` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` with `PHP JIT`, `Union Types v2` and other [new features](https://wiki.php.net/rfc#php_80 "New features implemented in PHP 8"). See [nightly build setup](#nightly-build-setup) for more information.
|
||||||
|
|
||||||
|
## :cloud: OS/Platform Support
|
||||||
|
|
||||||
|
Both `GitHub-hosted` runners and `self-hosted` runners are supported on the following operating systems.
|
||||||
|
|
||||||
|
### GitHub-Hosted Runners
|
||||||
|
|
||||||
|
|Virtual environment|YAML workflow label|Pre-installed PHP|
|
||||||
|
|--- |--- |--- |
|
||||||
|
|Ubuntu 16.04|`ubuntu-16.04`|`PHP 5.6` to `PHP 7.4`|
|
||||||
|
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|`PHP 7.1` to `PHP 7.4`|
|
||||||
|
|Ubuntu 20.04|`ubuntu-20.04`|`PHP 7.4`|
|
||||||
|
|Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 7.4`|
|
||||||
|
|macOS Catalina 10.15|`macos-latest` or `macos-10.15`|`PHP 7.4`|
|
||||||
|
|
||||||
|
### Self-Hosted Runners
|
||||||
|
|
||||||
|
|Host OS/Virtual environment|YAML workflow label|
|
||||||
|
|--- |--- |
|
||||||
|
|Ubuntu 16.04|`self-hosted` or `Linux`|
|
||||||
|
|Ubuntu 18.04|`self-hosted` or `Linux`|
|
||||||
|
|Ubuntu 20.04|`self-hosted` or `Linux`|
|
||||||
|
|Windows 7 and newer|`self-hosted` or `Windows`|
|
||||||
|
|Windows Server 2012 R2 and newer|`self-hosted` or `Windows`|
|
||||||
|
|macOS Catalina 10.15|`self-hosted` or `macOS`|
|
||||||
|
|
||||||
|
- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners.
|
||||||
|
|
||||||
|
## :heavy_plus_sign: PHP Extension Support
|
||||||
|
|
||||||
|
- On `ubuntu` by default extensions which are available as a package can be installed. PECL extensions if not available as a package can be installed by specifying `pecl` in the tools input.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with pecl extension
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: pecl
|
||||||
|
extensions: swoole
|
||||||
|
```
|
||||||
|
|
||||||
|
- On `windows` PECL extensions which have the `DLL` binary can be installed.
|
||||||
|
|
||||||
|
- On `macOS` PECL extensions can be installed.
|
||||||
|
|
||||||
|
- Extensions installed along with PHP if specified are enabled.
|
||||||
|
|
||||||
|
- Specific versions of PECL extensions can be installed by suffixing the version. This is useful for installing old versions of extensions which support end of life PHP versions.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with specific version of PECL extension
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '5.4'
|
||||||
|
tools: pecl
|
||||||
|
extensions: swoole-1.9.3
|
||||||
|
```
|
||||||
|
|
||||||
|
- Pre-release versions of PECL extensions can be setup by suffixing the extension with its state i.e `alpha`, `beta`, `devel` or `snapshot`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with pre-release PECL extension
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: pecl
|
||||||
|
extensions: xdebug-beta
|
||||||
|
```
|
||||||
|
|
||||||
|
- Shared extensions can be removed by prefixing them with a `:`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP and remove shared extension
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
extensions: :opcache
|
||||||
|
```
|
||||||
|
|
||||||
|
- Extension `intl` can be setup with specific `ICU` version for `PHP 5.6` to `PHP 7.4` in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with intl
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
extensions: intl-67.1
|
||||||
|
```
|
||||||
|
|
||||||
|
- Extensions which cannot be added or removed gracefully leave an error message in the logs, the action is not interrupted.
|
||||||
|
|
||||||
|
- These extensions have custom support - `cubrid`, `pdo_cubrid` and `gearman` on `Ubuntu`, and `blackfire`, `ioncube`, `oci8`, `pdo_oci`, `phalcon3` and `phalcon4` on all supported OS.
|
||||||
|
|
||||||
|
## :wrench: Tools Support
|
||||||
|
|
||||||
|
These tools can be setup globally using the `tools` input.
|
||||||
|
|
||||||
|
`blackfire`, `blackfire-player`, `codeception`, `composer`, `composer-normalize`, `composer-prefetcher`, `composer-require-checker`, `composer-unused`, `cs2pr`, `deployer`, `flex`, `grpc_php_plugin`, `infection`, `pecl`, `phan`, `phing`, `phinx`, `phive`, `phpcbf`, `phpcpd`, `php-config`, `php-cs-fixer`, `phpcs`, `phpize`, `phpmd`, `phpstan`, `phpunit`, `prestissimo`, `protoc`, `psalm`, `symfony`, `vapor-cli`
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with tools
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: php-cs-fixer, phpunit
|
||||||
|
```
|
||||||
|
|
||||||
|
To setup a particular version of a tool, specify it in the form `tool:version`.
|
||||||
|
Latest stable version of `composer` is setup by default. You can setup the required version by specifying `v1`, `v2`, `snapshot` or `preview` as version.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with composer v2
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: composer:v2
|
||||||
|
```
|
||||||
|
|
||||||
|
Latest versions of both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified in tools input. Please refer to the [official documentation](https://blackfire.io/docs/integrations/ci/github-actions "Blackfire.io documentation for GitHub Actions") for using `blackfire` with GitHub Actions.
|
||||||
|
|
||||||
|
Version for other tools should be in `semver` format and a valid release of the tool.
|
||||||
|
This is useful for installing tools for older versions of PHP.
|
||||||
|
For example to setup `PHPUnit` on `PHP 7.2`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with tools
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.2'
|
||||||
|
tools: phpunit:8.5.8
|
||||||
|
```
|
||||||
|
|
||||||
|
**Notes**
|
||||||
|
- If you have a tool in your `composer.json`, do not setup it globally using this action as the two instances of the tool might conflict.
|
||||||
|
- Tools which cannot be setup gracefully leave an error message in the logs, the action is not interrupted.
|
||||||
|
|
||||||
|
## :signal_strength: Coverage Support
|
||||||
|
|
||||||
|
### Xdebug
|
||||||
|
|
||||||
|
Specify `coverage: xdebug` to use `Xdebug`.
|
||||||
|
Runs on all [PHP versions supported](#tada-php-support "List of PHP versions supported on this GitHub Action").
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with Xdebug
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
coverage: xdebug
|
||||||
|
```
|
||||||
|
|
||||||
|
### PCOV
|
||||||
|
|
||||||
|
Specify `coverage: pcov` to use `PCOV` and disable `Xdebug`.
|
||||||
|
`PCOV` supports `PHP 7.1` and newer PHP versions.
|
||||||
|
Tests with `PCOV` run much faster than with `Xdebug`.
|
||||||
|
If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with PCOV
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
ini-values: pcov.directory=api #optional, see above for usage.
|
||||||
|
coverage: pcov
|
||||||
|
```
|
||||||
|
|
||||||
|
`PHPUnit` 8 and above supports `PCOV` out of the box.
|
||||||
|
If you are using `PHPUnit` 5, 6 or 7, you will need `krakjoe/pcov-clobber`.
|
||||||
|
Before executing your tests add the following step.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PCOV
|
||||||
|
run: |
|
||||||
|
composer require pcov/clobber
|
||||||
|
vendor/bin/pcov clobber
|
||||||
|
```
|
||||||
|
|
||||||
|
### Disable Coverage
|
||||||
|
|
||||||
|
Specify `coverage: none` to remove both `Xdebug` and `PCOV`.
|
||||||
|
Consider disabling the coverage using this PHP action for these reasons.
|
||||||
|
|
||||||
|
- You are not generating coverage reports while testing.
|
||||||
|
- It will remove `Xdebug`, which will have a positive impact on PHP performance.
|
||||||
|
- You are using `phpdbg` for running your tests.
|
||||||
|
- You are profiling your code using `blackfire`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with no coverage driver
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
coverage: none
|
||||||
|
```
|
||||||
|
|
||||||
|
## :memo: Usage
|
||||||
|
|
||||||
|
### Inputs
|
||||||
|
|
||||||
|
#### `php-version` (required)
|
||||||
|
|
||||||
|
- Specify the PHP version you want to setup.
|
||||||
|
- Accepts a `string`. For example `'7.4'`.
|
||||||
|
- See [PHP support](#tada-php-support) for supported PHP versions.
|
||||||
|
|
||||||
|
#### `extensions` (optional)
|
||||||
|
|
||||||
|
- Specify the extensions you want to add or remove.
|
||||||
|
- Accepts a `string` in csv-format. For example `mbstring, :opcache`.
|
||||||
|
- Non-default extensions prefixed with `:` are removed.
|
||||||
|
- See [PHP extension support](#heavy_plus_sign-php-extension-support) for more info.
|
||||||
|
|
||||||
|
#### `ini-values` (optional)
|
||||||
|
|
||||||
|
- Specify the values you want to add to `php.ini`.
|
||||||
|
- Accepts a `string` in csv-format. For example `post_max_size=256M, short_open_tag=On`.
|
||||||
|
|
||||||
|
#### `coverage` (optional)
|
||||||
|
|
||||||
|
- Specify the code coverage driver you want to setup.
|
||||||
|
- Accepts `xdebug`, `pcov` or `none`.
|
||||||
|
- See [coverage support](#signal_strength-coverage-support) for more info.
|
||||||
|
|
||||||
|
#### `tools` (optional)
|
||||||
|
|
||||||
|
- Specify the tools you want to setup.
|
||||||
|
- Accepts a `string` in csv-format. For example `phpunit, phpcs`
|
||||||
|
- See [tools Support](#wrench-tools-support) for tools supported.
|
||||||
|
|
||||||
|
See below for more info.
|
||||||
|
|
||||||
|
### Basic Setup
|
||||||
|
|
||||||
|
> Setup a particular PHP version.
|
||||||
|
|
||||||
Basic:
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
- name: Installing PHP
|
|
||||||
uses: shivammathur/setup-php@master
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: 7.3
|
php-version: '7.4'
|
||||||
- name: Check PHP Version
|
extensions: mbstring, intl
|
||||||
run: php -v
|
ini-values: post_max_size=256M, short_open_tag=On
|
||||||
- name: Check Composer Version
|
coverage: xdebug
|
||||||
run: composer -V
|
tools: php-cs-fixer, phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
Matrix Testing:
|
### Matrix Setup
|
||||||
|
|
||||||
|
> Setup multiple PHP versions on multiple operating systems.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 15
|
|
||||||
matrix:
|
matrix:
|
||||||
operating-system: [ubuntu-latest, windows-latest, macOS-latest]
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3']
|
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
|
||||||
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
|
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
- name: Install PHP
|
|
||||||
uses: shivammathur/setup-php@master
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions }}
|
php-version: ${{ matrix.php-versions }}
|
||||||
- name: Check PHP Version
|
extensions: mbstring, intl
|
||||||
run: php -v
|
ini-values: post_max_size=256M, short_open_tag=On
|
||||||
|
coverage: xdebug
|
||||||
|
tools: php-cs-fixer, phpunit
|
||||||
```
|
```
|
||||||
|
|
||||||
# License
|
### Nightly Build Setup
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
> Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP.
|
||||||
|
|
||||||
# Contributions
|
- This version is currently in development.
|
||||||
|
- `PECL` is installed by default with this version on `ubuntu` and `macOS`.
|
||||||
|
- Some user space extensions might not support this version currently.
|
||||||
|
- Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on this version.
|
||||||
|
- Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") implemented in this version.
|
||||||
|
|
||||||
Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup nightly PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.0'
|
||||||
|
extensions: mbstring
|
||||||
|
ini-values: opcache.jit_buffer_size=256M, opcache.jit=1235, pcre.jit=1
|
||||||
|
coverage: pcov
|
||||||
|
tools: php-cs-fixer, phpunit
|
||||||
|
```
|
||||||
|
|
||||||
|
### Self Hosted Setup
|
||||||
|
|
||||||
|
> Setup PHP on a self-hosted runner.
|
||||||
|
|
||||||
|
- To setup a dockerized self-hosted runner, refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Ubuntu) to setup in an `Ubuntu` container and refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Windows) to setup in a `Windows` container.
|
||||||
|
- To setup the runner directly on the host OS or in a virtual machine, follow this [requirements guide](https://github.com/shivammathur/setup-php/wiki/Requirements-for-self-hosted-runners "Requirements guide for self-hosted runner to run setup-php") before setting up the self-hosted runner.
|
||||||
|
- If your workflow uses [services](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idservices "GitHub Actions Services"), then setup the runner on a Linux host or in a Linux virtual machine. GitHub Actions does not support nested virtualization on Linux, so services will not work in a dockerized container.
|
||||||
|
|
||||||
|
Specify the environment variable `runner` with the value `self-hosted`. Without this your workflow will fail.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
runs-on: self-hosted
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
|
||||||
|
name: PHP ${{ matrix.php-versions }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
env:
|
||||||
|
runner: self-hosted # Specify the runner.
|
||||||
|
```
|
||||||
|
|
||||||
|
**Notes**
|
||||||
|
- Do not setup multiple self-hosted runners on the a single server instance as parallel workflow will conflict with each other.
|
||||||
|
- Do not setup self-hosted runners on the side on your development environment or your production server.
|
||||||
|
|
||||||
|
### Local Testing Setup
|
||||||
|
|
||||||
|
> Test your `Ubuntu` workflow locally using [`nektos/act`](https://github.com/nektos/act "Project to test GitHub Actions locally").
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: PHP 7.4 Test
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: 7.4
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the workflow locally with `act` using [`shivammathur/node`](https://github.com/shivammathur/node-docker "Docker image to run setup-php") docker image.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# For runs-on: ubuntu-latest
|
||||||
|
act -P ubuntu-latest=shivammathur/node:latest
|
||||||
|
|
||||||
|
# For runs-on: ubuntu-20.04
|
||||||
|
act -P ubuntu-20.04=shivammathur/node:focal
|
||||||
|
|
||||||
|
# For runs-on: ubuntu-18.04
|
||||||
|
act -P ubuntu-18.04=shivammathur/node:bionic
|
||||||
|
|
||||||
|
# For runs-on: ubuntu-16.04
|
||||||
|
act -P ubuntu-16.04=shivammathur/node:xenial
|
||||||
|
```
|
||||||
|
|
||||||
|
### Thread Safe Setup
|
||||||
|
|
||||||
|
> Setup both `TS` and `NTS` PHP on `Windows`.
|
||||||
|
|
||||||
|
- `NTS` versions are setup by default.
|
||||||
|
- On `Ubuntu` and `macOS` only `NTS` versions are supported.
|
||||||
|
- On `Windows` both `TS` and `NTS` versions are supported.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
runs-on: windows-latest
|
||||||
|
name: Setup PHP TS on Windows
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
env:
|
||||||
|
phpts: ts # specify ts or nts
|
||||||
|
```
|
||||||
|
|
||||||
|
### Force Update
|
||||||
|
|
||||||
|
> Update to latest patch of PHP versions.
|
||||||
|
|
||||||
|
- Pre-installed PHP versions on the GitHub Actions runner are not updated to their latest patch release by default.
|
||||||
|
- You can specify the `update` environment variable to `true` to force update to the latest release.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with latest versions
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
env:
|
||||||
|
update: true # specify true or false
|
||||||
|
```
|
||||||
|
|
||||||
|
### Verbose Setup
|
||||||
|
|
||||||
|
> Debug your workflow
|
||||||
|
|
||||||
|
To debug any issues, you can use the `verbose` tag instead of `v2`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP with logs
|
||||||
|
uses: shivammathur/setup-php@verbose
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Cache Extensions
|
||||||
|
|
||||||
|
You can cache PHP extensions using `shivammathur/cache-extensions` and `action/cache` GitHub Actions. Extensions which take very long to setup when cached are available in the next workflow run and are enabled directly. This reduces the workflow execution time.
|
||||||
|
Refer to [`shivammathur/cache-extensions`](https://github.com/shivammathur/cache-extensions "GitHub Action to cache php extensions") for details.
|
||||||
|
|
||||||
|
### Cache Composer Dependencies
|
||||||
|
|
||||||
|
If your project uses composer, you can persist composer's internal cache directory. Dependencies cached are loaded directly instead of downloading them while installation. The files cached are available across check-runs and will reduce the workflow execution time.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --prefer-dist
|
||||||
|
```
|
||||||
|
|
||||||
|
**Notes**
|
||||||
|
- Please do not cache `vendor` directory using `action/cache` as that will have side-effects.
|
||||||
|
- In the above example, if you support a range of `composer` dependencies and do not commit `composer.lock`, you can use the hash of `composer.json` as the key for your cache.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Cache Node.js Dependencies
|
||||||
|
|
||||||
|
If your project has node.js dependencies, you can persist npm's or yarn's cache directory. The cached files are available across check-runs and will reduce the workflow execution time.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Get node.js cache directory
|
||||||
|
id: nodecache
|
||||||
|
run: echo "::set-output name=dir::$(npm config get cache)" # Use $(yarn cache dir) for yarn
|
||||||
|
|
||||||
|
- name: Cache dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.nodecache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn
|
||||||
|
restore-keys: ${{ runner.os }}-node-
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** Please do not cache `node_modules` directory as that will have side-effects.
|
||||||
|
|
||||||
|
### Composer GitHub OAuth
|
||||||
|
|
||||||
|
If you have a number of workflows which setup multiple tools or have many composer dependencies, you might hit the GitHub's rate limit for composer. To avoid that you can add an `OAuth` token to the composer's config by setting `COMPOSER_TOKEN` environment variable. You can use [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token "GITHUB_TOKEN documentation") secret for this purpose.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
env:
|
||||||
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Problem Matchers
|
||||||
|
|
||||||
|
#### PHP
|
||||||
|
|
||||||
|
Setup problem matchers for your `PHP` output by adding this step after the `setup-php` step. This will scan the logs for PHP errors and warnings, and surface them prominently in the GitHub Actions UI by creating annotations and log file decorations.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup problem matchers for PHP
|
||||||
|
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PHPUnit
|
||||||
|
|
||||||
|
Setup problem matchers for your `PHPUnit` output by adding this step after the `setup-php` step. This will scan the logs for failing tests and surface that information prominently in the GitHub Actions UI by creating annotations and log file decorations.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup problem matchers for PHPUnit
|
||||||
|
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Other Tools
|
||||||
|
|
||||||
|
For tools that support `checkstyle` reporting like `phpstan`, `psalm`, `php-cs-fixer` and `phpcs` you can use `cs2pr` to annotate your code.
|
||||||
|
For examples refer to [cs2pr documentation](https://github.com/staabm/annotate-pull-request-from-checkstyle).
|
||||||
|
|
||||||
|
> Here is an example with `phpstan`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.4'
|
||||||
|
tools: cs2pr, phpstan
|
||||||
|
|
||||||
|
- name: PHPStan
|
||||||
|
run: phpstan analyse src --error-format=checkstyle | cs2pr
|
||||||
|
```
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
|
||||||
|
Examples of using `setup-php` with various PHP Frameworks and Packages.
|
||||||
|
|
||||||
|
|Framework/Package|Runs on|Workflow|
|
||||||
|
|--- |--- |--- |
|
||||||
|
|Blackfire|`macOS`, `ubuntu` and `windows`|[blackfire.yml](./examples/blackfire.yml "GitHub Action using Blackfire")|
|
||||||
|
|Blackfire Player|`macOS`, `ubuntu` and `windows`|[blackfire-player.yml](./examples/blackfire-player.yml "GitHub Action using Blackfire Player")|
|
||||||
|
|CakePHP with `MySQL` and `Redis`|`ubuntu`|[cakephp-mysql.yml](./examples/cakephp-mysql.yml "GitHub Action for CakePHP with MySQL and Redis")|
|
||||||
|
|CakePHP with `PostgreSQL` and `Redis`|`ubuntu`|[cakephp-postgres.yml](./examples/cakephp-postgres.yml "GitHub Action for CakePHP with Postgres and Redis")|
|
||||||
|
|CakePHP without services|`macOS`, `ubuntu` and `windows`|[cakephp.yml](./examples/cakephp.yml "GitHub Action for CakePHP without services")|
|
||||||
|
|CodeIgniter|`macOS`, `ubuntu` and `windows`|[codeigniter.yml](./examples/codeigniter.yml "GitHub Action for CodeIgniter")|
|
||||||
|
|Laravel with `MySQL` and `Redis`|`ubuntu`|[laravel-mysql.yml](./examples/laravel-mysql.yml "GitHub Action for Laravel with MySQL and Redis")|
|
||||||
|
|Laravel with `PostgreSQL` and `Redis`|`ubuntu`|[laravel-postgres.yml](./examples/laravel-postgres.yml "GitHub Action for Laravel with PostgreSQL and Redis")|
|
||||||
|
|Laravel without services|`macOS`, `ubuntu` and `windows`|[laravel.yml](./examples/laravel.yml "GitHub Action for Laravel without services")|
|
||||||
|
|Lumen with `MySQL` and `Redis`|`ubuntu`|[lumen-mysql.yml](./examples/lumen-mysql.yml "GitHub Action for Lumen with MySQL and Redis")|
|
||||||
|
|Lumen with `PostgreSQL` and `Redis`|`ubuntu`|[lumen-postgres.yml](./examples/lumen-postgres.yml "GitHub Action for Lumen with PostgreSQL and Redis")|
|
||||||
|
|Lumen without services|`macOS`, `ubuntu` and `windows`|[lumen.yml](./examples/lumen.yml "GitHub Action for Lumen without services")|
|
||||||
|
|Phalcon with `MySQL`|`ubuntu`|[phalcon-mysql.yml](./examples/phalcon-mysql.yml "GitHub Action for Phalcon with MySQL")|
|
||||||
|
|Phalcon with `PostgreSQL`|`ubuntu`|[phalcon-postgres.yml](./examples/phalcon-postgres.yml "GitHub Action for Phalcon with PostgreSQL")|
|
||||||
|
|Roots/bedrock|`ubuntu`|[bedrock.yml](./examples/bedrock.yml "GitHub Action for Wordpress Development using @roots/bedrock")|
|
||||||
|
|Roots/sage|`ubuntu`|[sage.yml](./examples/sage.yml "GitHub Action for Wordpress Development using @roots/sage")|
|
||||||
|
|Slim Framework|`macOS`, `ubuntu` and `windows`|[slim-framework.yml](./examples/slim-framework.yml "GitHub Action for Slim Framework")|
|
||||||
|
|Symfony with `MySQL`|`ubuntu`|[symfony-mysql.yml](./examples/symfony-mysql.yml "GitHub Action for Symfony with MySQL")|
|
||||||
|
|Symfony with `PostgreSQL`|`ubuntu`|[symfony-postgres.yml](./examples/symfony-postgres.yml "GitHub Action for Symfony with PostgreSQL")|
|
||||||
|
|Symfony without services|`macOS`, `ubuntu` and `windows`|[symfony.yml](./examples/symfony.yml "GitHub Action for Symfony without services")|
|
||||||
|
|Yii2 Starter Kit with `MySQL`|`ubuntu`|[yii2-mysql.yml](./examples/yii2-mysql.yml "GitHub Action for Yii2 Starter Kit with MySQL")|
|
||||||
|
|Yii2 Starter Kit with `PostgreSQL`|`ubuntu`|[yii2-postgres.yml](./examples/yii2-postgres.yml "GitHub Action for Yii2 Starter Kit with PostgreSQL")|
|
||||||
|
|Zend Framework|`macOS`, `ubuntu` and `windows`|[zend-framework.yml](./examples/zend-framework.yml "GitHub Action for Zend Framework")|
|
||||||
|
|
||||||
|
## :bookmark: Versioning
|
||||||
|
|
||||||
|
- It is highly recommended to use the `v2` tag as `setup-php` version. It is a rolling tag and is synced with latest minor and patch releases. With `v2` you automatically get the bug fixes, new features and support for latest PHP releases. For debugging any issues `verbose` tag can be used temporarily. It outputs all the logs and is also synced with the latest releases.
|
||||||
|
- Semantic release versions can also be used. It is recommended to [use dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot "Setup Dependabot with GitHub Actions") with semantic versioning to keep the actions in your workflows up to date.
|
||||||
|
- Commit SHA can also be used, but are not recommended. They have to be updated with every release manually, without which you will not get any bug fixes or new features.
|
||||||
|
- Using the `master` branch as version is highly discouraged, it might break your workflow after major releases as they have breaking changes.
|
||||||
|
- If you are using the `v1` tag or a `1.x.y` version, it is recommended that you [switch to v2](https://github.com/shivammathur/setup-php/wiki/Switch-to-v2 "Guide for switching from setup-php v1 to v2") as `v1` only gets critical bug fixes. Maintenance support for `v1` will be dropped with the last `PHP 8.0` release.
|
||||||
|
|
||||||
|
## :scroll: License
|
||||||
|
|
||||||
|
- The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/setup-php").
|
||||||
|
- This project has multiple [dependencies](#package-dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
||||||
|
- The logo for `setup-php` is a derivative work of [php.net logo](https://www.php.net/download-logos.php) and is licensed under the [CC BY-SA 4.0 License](https://creativecommons.org/licenses/by-sa/4.0/ "Creative Commons License").
|
||||||
|
|
||||||
|
## :+1: Contributions
|
||||||
|
|
||||||
|
> Contributions are welcome!
|
||||||
|
|
||||||
|
- See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/setup-php contribution guide") before you start.
|
||||||
|
- If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/setup-php/issues "Issues reported").
|
||||||
|
|
||||||
|
*Join the list of setup-php contributors*
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/shivammathur/setup-php/graphs/contributors">
|
||||||
|
<img src="https://opencollective.com/setup-php/contributors.svg?width=1024&button=false" alt="setup-php contributers" width="100%">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## :sparkling_heart: Support This Project
|
||||||
|
|
||||||
|
- Please star the project and share it. If you blog, please share your experience of using this action.
|
||||||
|
- Please consider supporting our work by sponsoring using [Open Collective](https://opencollective.com/setup-php), [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal") or [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon").
|
||||||
|
- If you use `setup-php` at your company, please [reach out](mailto:contact@setup-php.com) to sponsor the project.
|
||||||
|
|
||||||
|
*Huge thanks to the following companies for supporting `setup-php`*
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://www.jetbrains.com/?from=setup-php">
|
||||||
|
<img src="https://shivammathur.com/jetbrains.svg" alt="JetBrains" width="106" height="60">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://blackfire.io/?utm_source=setup-php">
|
||||||
|
<img src="https://shivammathur.com/blackfire.svg" alt="Blackfire" width="212" height="60">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://tidelift.com/subscription/pkg/npm-setup-php">
|
||||||
|
<img src="https://shivammathur.com/tidelift.png" alt="Tidelift" width="70" height="60">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## :package: Dependencies
|
||||||
|
|
||||||
|
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
||||||
|
- [gplessis/dotdeb-php](https://github.com/gplessis/dotdeb-php "Packaging for end of life PHP versions")
|
||||||
|
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
|
||||||
|
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
|
||||||
|
- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
|
||||||
|
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
|
||||||
|
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
|
||||||
|
- [shivammathur/homebrew-php](https://github.com/shivammathur/homebrew-php "Tap for PHP builds on MacOS")
|
||||||
|
- [shivammathur/icu-intl](https://github.com/shivammathur/icu-intl "icu4c and php-intl builds")
|
||||||
|
- [shivammathur/php-builder](https://github.com/shivammathur/php-builder "Nightly PHP package for Ubuntu")
|
||||||
|
- [shivammathur/php-builder-windows](https://github.com/shivammathur/php-builder-windows "Nightly PHP package for Windows")
|
||||||
|
- [shivammathur/php-ubuntu](https://github.com/shivammathur/php-ubuntu "Cache stable PHP Packages for Ubuntu")
|
||||||
|
- [shivammathur/php5-darwin](https://github.com/shivammathur/php5-darwin "Scripts to setup PHP5 versions on darwin")
|
||||||
|
- [shivammathur/php5-ubuntu](https://github.com/shivammathur/php5-ubuntu "Scripts to setup PHP5 versions on ubuntu")
|
||||||
|
|
||||||
|
## :bookmark_tabs: Further Reading
|
||||||
|
|
||||||
|
- [About GitHub Actions](https://github.com/features/actions "GitHub Actions")
|
||||||
|
- [GitHub Actions Syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions "GitHub Actions Syntax")
|
||||||
|
- [Other Awesome Actions](https://github.com/sdras/awesome-actions "List of Awesome GitHub Actions")
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import * as config from '../src/config';
|
||||||
|
|
||||||
|
describe('Config tests', () => {
|
||||||
|
it('checking addINIValuesOnWindows', async () => {
|
||||||
|
let win32: string = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
expect(win32).toContain(
|
||||||
|
'Add-Content "$php_dir\\php.ini" "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
|
||||||
|
);
|
||||||
|
|
||||||
|
win32 = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'openbsd'
|
||||||
|
);
|
||||||
|
expect(win32).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addINIValuesOnLinux', async () => {
|
||||||
|
let linux: string = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'linux',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
expect(linux).toContain(
|
||||||
|
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
|
||||||
|
);
|
||||||
|
|
||||||
|
linux = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'openbsd'
|
||||||
|
);
|
||||||
|
expect(linux).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addINIValuesOnDarwin', async () => {
|
||||||
|
let darwin: string = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'darwin'
|
||||||
|
);
|
||||||
|
expect(darwin).toContain(
|
||||||
|
'echo "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"'
|
||||||
|
);
|
||||||
|
|
||||||
|
darwin = await config.addINIValues(
|
||||||
|
'post_max_size=256M, short_open_tag=On, date.timezone=Asia/Kolkata',
|
||||||
|
'openbsd'
|
||||||
|
);
|
||||||
|
expect(darwin).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
import * as coverage from '../src/coverage';
|
||||||
|
|
||||||
|
describe('Config tests', () => {
|
||||||
|
it('checking addCoverage with PCOV on windows', async () => {
|
||||||
|
let win32: string = await coverage.addCoverage('PCOV', '7.4', 'win32');
|
||||||
|
expect(win32).toContain('Add-Extension pcov');
|
||||||
|
expect(win32).toContain('Remove-Extension xdebug');
|
||||||
|
|
||||||
|
win32 = await coverage.addCoverage('pcov', '7.0', 'win32');
|
||||||
|
expect(win32).toContain('PHP 7.1 or newer is required');
|
||||||
|
|
||||||
|
win32 = await coverage.addCoverage('pcov', '5.6', 'win32');
|
||||||
|
expect(win32).toContain('PHP 7.1 or newer is required');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with PCOV on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('pcov', '7.4', 'linux');
|
||||||
|
expect(linux).toContain('add_extension pcov');
|
||||||
|
expect(linux).toContain('remove_extension xdebug');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with PCOV on darwin', async () => {
|
||||||
|
const darwin: string = await coverage.addCoverage('pcov', '7.4', 'darwin');
|
||||||
|
expect(darwin).toContain('add_extension pcov');
|
||||||
|
expect(darwin).toContain('remove_extension xdebug');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug on windows', async () => {
|
||||||
|
const win32: string = await coverage.addCoverage('xdebug', '7.4', 'win32');
|
||||||
|
expect(win32).toContain('Add-Extension xdebug');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
||||||
|
expect(linux).toContain('add_extension xdebug');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug3', '7.4', 'linux');
|
||||||
|
expect(linux).toContain('add_extension_from_source xdebug');
|
||||||
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug3 on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug3', '8.0', 'linux');
|
||||||
|
expect(linux).toContain('add_extension xdebug');
|
||||||
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('xdebug', '8.0', 'linux');
|
||||||
|
expect(linux).toContain('add_extension xdebug');
|
||||||
|
expect(linux).toContain('echo "xdebug.mode=coverage"');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addCoverage with Xdebug on darwin', async () => {
|
||||||
|
const darwin: string = await coverage.addCoverage(
|
||||||
|
'xdebug',
|
||||||
|
'7.4',
|
||||||
|
'darwin'
|
||||||
|
);
|
||||||
|
expect(darwin).toContain('add_extension xdebug');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking disableCoverage windows', async () => {
|
||||||
|
const win32 = await coverage.addCoverage('none', '7.4', 'win32');
|
||||||
|
expect(win32).toContain('Remove-Extension xdebug');
|
||||||
|
expect(win32).toContain('Remove-Extension pcov');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking disableCoverage on linux', async () => {
|
||||||
|
const linux: string = await coverage.addCoverage('none', '7.4', 'linux');
|
||||||
|
expect(linux).toContain('remove_extension xdebug');
|
||||||
|
expect(linux).toContain('remove_extension pcov');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking disableCoverage on darwin', async () => {
|
||||||
|
const darwin: string = await coverage.addCoverage('none', '7.4', 'darwin');
|
||||||
|
expect(darwin).toContain('remove_extension xdebug');
|
||||||
|
expect(darwin).toContain('remove_extension pcov');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking no or invalid coverage driver', async () => {
|
||||||
|
let nocov: string = await coverage.addCoverage('nocov', '7.x', 'any');
|
||||||
|
expect(nocov).toEqual('');
|
||||||
|
|
||||||
|
nocov = await coverage.addCoverage('', '7.x', 'any');
|
||||||
|
expect(nocov).toEqual('');
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,207 @@
|
|||||||
|
import * as extensions from '../src/extensions';
|
||||||
|
|
||||||
|
describe('Extension tests', () => {
|
||||||
|
it('checking addExtensionOnWindows', async () => {
|
||||||
|
let win32: string = await extensions.addExtension(
|
||||||
|
'Xdebug, pcov, sqlite, :intl, phalcon4, ioncube, oci8, pdo_oci, ast-beta, grpc-1.2.3, inotify-1.2.3alpha2',
|
||||||
|
'7.4',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
expect(win32).toContain('Add-Extension xdebug');
|
||||||
|
expect(win32).toContain('Add-Extension pcov');
|
||||||
|
expect(win32).toContain('Add-Extension sqlite3');
|
||||||
|
expect(win32).toContain('Remove-Extension intl');
|
||||||
|
expect(win32).toContain('Add-Phalcon phalcon4');
|
||||||
|
expect(win32).toContain('Add-Ioncube');
|
||||||
|
expect(win32).toContain('Add-Oci oci8');
|
||||||
|
expect(win32).toContain('Add-Oci pdo_oci');
|
||||||
|
expect(win32).toContain('Add-Extension ast beta');
|
||||||
|
expect(win32).toContain('Add-Extension grpc stable 1.2.3');
|
||||||
|
expect(win32).toContain('Add-Extension inotify alpha 1.2.3');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('pcov', '5.6', 'win32');
|
||||||
|
expect(win32).toContain(
|
||||||
|
'Add-Log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
||||||
|
);
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('mysql', '7.4', 'win32');
|
||||||
|
expect(win32).toContain('Add-Extension mysqli');
|
||||||
|
expect(win32).toContain('Add-Extension mysqlnd');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('mysql', '8.0', 'win32');
|
||||||
|
expect(win32).toContain('Add-Extension mysqli');
|
||||||
|
expect(win32).toContain('Add-Extension mysqlnd');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('mysql', '5.5', 'win32');
|
||||||
|
expect(win32).toContain('Add-Extension mysql');
|
||||||
|
expect(win32).toContain('Add-Extension mysqli');
|
||||||
|
expect(win32).toContain('Add-Extension mysqlnd');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension(
|
||||||
|
'phalcon3, does_not_exist',
|
||||||
|
'7.2',
|
||||||
|
'win32',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
expect(win32).toContain('Add-Phalcon phalcon3');
|
||||||
|
expect(win32).toContain('Add-Extension does_not_exist');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
||||||
|
expect(win32).toContain('Platform openbsd is not supported');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('blackfire', '7.3', 'win32');
|
||||||
|
expect(win32).toContain('Add-Blackfire blackfire');
|
||||||
|
|
||||||
|
win32 = await extensions.addExtension('blackfire-1.31.0', '7.3', 'win32');
|
||||||
|
expect(win32).toContain('Add-Blackfire blackfire-1.31.0');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addExtensionOnLinux', async () => {
|
||||||
|
let linux: string = await extensions.addExtension(
|
||||||
|
'Xdebug, xdebug3, pcov, sqlite, :intl, ast, uopz, ast-beta, pdo_mysql, pdo-odbc, xdebug-alpha, grpc-1.2.3',
|
||||||
|
'7.4',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
expect(linux).toContain(
|
||||||
|
'add_extension_from_source xdebug xdebug/xdebug master --enable-xdebug zend_extension'
|
||||||
|
);
|
||||||
|
expect(linux).toContain('sudo $debconf_fix apt-get install -y php7.4-pcov');
|
||||||
|
expect(linux).toContain(
|
||||||
|
'sudo $debconf_fix apt-get install -y php7.4-sqlite3'
|
||||||
|
);
|
||||||
|
expect(linux).toContain('remove_extension intl');
|
||||||
|
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-ast');
|
||||||
|
expect(linux).toContain('sudo $debconf_fix apt-get install -y php-uopz');
|
||||||
|
expect(linux).toContain('add_unstable_extension ast beta extension');
|
||||||
|
expect(linux).toContain('add_pdo_extension mysql');
|
||||||
|
expect(linux).toContain('add_pdo_extension odbc');
|
||||||
|
expect(linux).toContain('add_pecl_extension grpc 1.2.3 extension');
|
||||||
|
expect(linux).toContain(
|
||||||
|
'add_unstable_extension xdebug alpha zend_extension'
|
||||||
|
);
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('xdebug3', '8.0', 'linux');
|
||||||
|
expect(linux).toContain(
|
||||||
|
'sudo $debconf_fix apt-get install -y php8.0-xdebug'
|
||||||
|
);
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('pcov', '5.6', 'linux');
|
||||||
|
expect(linux).toContain(
|
||||||
|
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
||||||
|
);
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('gearman', '7.0', 'linux');
|
||||||
|
expect(linux).toContain('add_gearman');
|
||||||
|
linux = await extensions.addExtension('gearman', '7.4', 'linux');
|
||||||
|
expect(linux).toContain('add_gearman');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('pdo_cubrid', '7.0', 'linux');
|
||||||
|
expect(linux).toContain('add_cubrid pdo_cubrid');
|
||||||
|
linux = await extensions.addExtension('cubrid', '7.4', 'linux');
|
||||||
|
expect(linux).toContain('add_cubrid cubrid');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
||||||
|
expect(linux).toContain('Platform openbsd is not supported');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('phalcon3, phalcon4', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_phalcon phalcon3');
|
||||||
|
expect(linux).toContain('add_phalcon phalcon4');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('ioncube', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_ioncube');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('oci8, pdo_oci', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_oci oci8');
|
||||||
|
expect(linux).toContain('add_oci pdo_oci');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('blackfire', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_blackfire blackfire');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('blackfire-1.31.0', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_blackfire blackfire-1.31.0');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('intl-65.1', '5.6', 'linux');
|
||||||
|
expect(linux).toContain('add_intl intl-65.1');
|
||||||
|
|
||||||
|
linux = await extensions.addExtension('intl-67.1', '7.3', 'linux');
|
||||||
|
expect(linux).toContain('add_intl intl-67.1');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addExtensionOnDarwin', async () => {
|
||||||
|
let darwin: string = await extensions.addExtension(
|
||||||
|
'Xdebug, pcov, grpc, protobuf, swoole, sqlite, oci8, pdo_oci, :intl, ast-beta, grpc-1.2.3',
|
||||||
|
'7.2',
|
||||||
|
'darwin'
|
||||||
|
);
|
||||||
|
expect(darwin).toContain('add_brew_extension xdebug');
|
||||||
|
expect(darwin).toContain('add_brew_extension pcov');
|
||||||
|
expect(darwin).toContain('add_brew_extension grpc');
|
||||||
|
expect(darwin).toContain('add_brew_extension protobuf');
|
||||||
|
expect(darwin).toContain('add_brew_extension swoole');
|
||||||
|
expect(darwin).toContain('pecl_install sqlite3');
|
||||||
|
expect(darwin).toContain('remove_extension intl');
|
||||||
|
expect(darwin).toContain('add_unstable_extension ast beta extension');
|
||||||
|
expect(darwin).toContain('add_pecl_extension grpc 1.2.3 extension');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('phalcon3', '7.0', 'darwin');
|
||||||
|
expect(darwin).toContain('add_phalcon phalcon3');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('phalcon4', '7.3', 'darwin');
|
||||||
|
expect(darwin).toContain('add_phalcon phalcon4');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('ioncube', '7.3', 'darwin');
|
||||||
|
expect(darwin).toContain('add_ioncube');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('oci8, pdo_oci', '7.3', 'darwin');
|
||||||
|
expect(darwin).toContain('add_oci oci8');
|
||||||
|
expect(darwin).toContain('add_oci pdo_oci');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('pcov', '5.6', 'darwin');
|
||||||
|
expect(darwin).toContain(
|
||||||
|
'add_log "$cross" "pcov" "pcov is not supported on PHP 5.6"'
|
||||||
|
);
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('pcov', '7.2', 'darwin');
|
||||||
|
expect(darwin).toContain('add_brew_extension pcov');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('xdebug', '5.6', 'darwin');
|
||||||
|
expect(darwin).toContain('add_brew_extension xdebug');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('xdebug', '7.0', 'darwin');
|
||||||
|
expect(darwin).toContain('add_brew_extension xdebug');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('xdebug', '7.2', 'darwin');
|
||||||
|
expect(darwin).toContain('add_brew_extension xdebug');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('redis', '5.6', 'darwin');
|
||||||
|
expect(darwin).toContain('pecl_install redis-2.2.8');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('redis', '7.2', 'darwin');
|
||||||
|
expect(darwin).toContain('pecl_install redis');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('imagick', '5.6', 'darwin');
|
||||||
|
expect(darwin).toContain('brew install pkg-config imagemagick');
|
||||||
|
expect(darwin).toContain('pecl_install imagick');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('imagick', '7.4', 'darwin');
|
||||||
|
expect(darwin).toContain('brew install pkg-config imagemagick');
|
||||||
|
expect(darwin).toContain('pecl_install imagick');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('blackfire', '7.3', 'darwin');
|
||||||
|
expect(darwin).toContain('add_blackfire blackfire');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('blackfire-1.31.0', '7.3', 'darwin');
|
||||||
|
expect(darwin).toContain('add_blackfire blackfire-1.31.0');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension(
|
||||||
|
'does_not_exist',
|
||||||
|
'7.2',
|
||||||
|
'darwin',
|
||||||
|
false
|
||||||
|
);
|
||||||
|
expect(darwin).toContain('add_extension does_not_exist');
|
||||||
|
|
||||||
|
darwin = await extensions.addExtension('xdebug', '7.2', 'openbsd');
|
||||||
|
expect(darwin).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
});
|
||||||
+166
-4
@@ -1,6 +1,168 @@
|
|||||||
let a = '2';
|
import * as install from '../src/install';
|
||||||
describe('Finder tests', () => {
|
|
||||||
it('checking 2', async () => {
|
/**
|
||||||
expect(a).toBe('2');
|
* Mock install.ts
|
||||||
|
*/
|
||||||
|
jest.mock('../src/install', () => ({
|
||||||
|
build: jest.fn().mockImplementation(
|
||||||
|
async (
|
||||||
|
filename: string,
|
||||||
|
version: string,
|
||||||
|
os_version: string
|
||||||
|
): Promise<string> => {
|
||||||
|
const extension_csv: string = process.env['extensions'] || '';
|
||||||
|
const ini_values_csv: string = process.env['ini-values'] || '';
|
||||||
|
const coverage_driver: string = process.env['coverage'] || '';
|
||||||
|
let tools_csv: string = process.env['tools'] || '';
|
||||||
|
const pecl: string = process.env['pecl'] || '';
|
||||||
|
if (pecl == 'true') {
|
||||||
|
tools_csv = 'pecl, ' + tools_csv;
|
||||||
|
}
|
||||||
|
|
||||||
|
let script = 'initial script ' + filename + version + os_version;
|
||||||
|
if (tools_csv) {
|
||||||
|
script += 'add_tool';
|
||||||
|
}
|
||||||
|
if (extension_csv) {
|
||||||
|
script += 'install extensions';
|
||||||
|
}
|
||||||
|
if (coverage_driver) {
|
||||||
|
script += 'set coverage driver';
|
||||||
|
}
|
||||||
|
if (ini_values_csv) {
|
||||||
|
script += 'edit php.ini';
|
||||||
|
}
|
||||||
|
|
||||||
|
return script;
|
||||||
|
}
|
||||||
|
),
|
||||||
|
run: jest.fn().mockImplementation(
|
||||||
|
async (): Promise<string> => {
|
||||||
|
const os_version: string = process.env['RUNNER_OS'] || '';
|
||||||
|
let version: string = process.env['php-version'] || '';
|
||||||
|
version = version.length > 1 ? version.slice(0, 3) : version + '.0';
|
||||||
|
let script = '';
|
||||||
|
switch (os_version) {
|
||||||
|
case 'darwin':
|
||||||
|
case 'linux':
|
||||||
|
script = await install.build(os_version + '.sh', version, os_version);
|
||||||
|
script += 'bash script.sh ' + version + ' ' + __dirname;
|
||||||
|
break;
|
||||||
|
case 'win32':
|
||||||
|
script = await install.build(os_version + '.sh', version, os_version);
|
||||||
|
script += 'pwsh script.ps1 ' + version + ' ' + __dirname;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
script += os_version + ' is not supported';
|
||||||
|
}
|
||||||
|
|
||||||
|
return script;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to set the process.env
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
* @param os
|
||||||
|
* @param extension_csv
|
||||||
|
* @param ini_values_csv
|
||||||
|
* @param coverage_driver
|
||||||
|
* @param tools
|
||||||
|
*/
|
||||||
|
function setEnv(
|
||||||
|
version: string | number,
|
||||||
|
os: string,
|
||||||
|
extension_csv: string,
|
||||||
|
ini_values_csv: string,
|
||||||
|
coverage_driver: string,
|
||||||
|
tools: string
|
||||||
|
): void {
|
||||||
|
process.env['php-version'] = version.toString();
|
||||||
|
process.env['RUNNER_OS'] = os;
|
||||||
|
process.env['extensions'] = extension_csv;
|
||||||
|
process.env['ini-values'] = ini_values_csv;
|
||||||
|
process.env['coverage'] = coverage_driver;
|
||||||
|
process.env['tools'] = tools;
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Install', () => {
|
||||||
|
it('Test install on windows', async () => {
|
||||||
|
setEnv('7.0', 'win32', '', '', '', '');
|
||||||
|
|
||||||
|
let script: string = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('pwsh script.ps1 7.0 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv('7.3', 'win32', '', '', '', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('pwsh script.ps1 7.3 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv('7.3', 'win32', 'a, b', 'a=b', 'x', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('install extensions');
|
||||||
|
expect(script).toContain('edit php.ini');
|
||||||
|
expect(script).toContain('set coverage driver');
|
||||||
|
expect(script).toContain('pwsh script.ps1 7.3 ' + __dirname);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Test install on linux', async () => {
|
||||||
|
setEnv('7.3', 'linux', '', '', '', '');
|
||||||
|
|
||||||
|
let script: string = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash script.sh 7.3 ');
|
||||||
|
|
||||||
|
setEnv('7.3', 'linux', 'a, b', 'a=b', 'x', 'phpunit');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('install extensions');
|
||||||
|
expect(script).toContain('edit php.ini');
|
||||||
|
expect(script).toContain('set coverage driver');
|
||||||
|
expect(script).toContain('bash script.sh 7.3');
|
||||||
|
expect(script).toContain('add_tool');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Test install on darwin', async () => {
|
||||||
|
setEnv('7.3', 'darwin', '', '', '', '');
|
||||||
|
|
||||||
|
let script: string = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash script.sh 7.3 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv('7.3', 'darwin', 'a, b', 'a=b', 'x', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('install extensions');
|
||||||
|
expect(script).toContain('edit php.ini');
|
||||||
|
expect(script).toContain('set coverage driver');
|
||||||
|
expect(script).toContain('bash script.sh 7.3 ' + __dirname);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Test malformed version inputs', async () => {
|
||||||
|
setEnv('7.4.1', 'darwin', '', '', '', '');
|
||||||
|
|
||||||
|
let script: string = '' + '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash script.sh 7.4 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv(8.0, 'darwin', '', '', '', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash script.sh 8.0 ' + __dirname);
|
||||||
|
|
||||||
|
setEnv(8, 'darwin', '', '', '', '');
|
||||||
|
|
||||||
|
script = '' + (await install.run());
|
||||||
|
expect(script).toContain('initial script');
|
||||||
|
expect(script).toContain('bash script.sh 8.0 ' + __dirname);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import * as io from '@actions/io';
|
||||||
|
import * as matchers from '../src/matchers';
|
||||||
|
|
||||||
|
jest.mock('@actions/io');
|
||||||
|
|
||||||
|
describe('Matchers', () => {
|
||||||
|
it('Add matchers', async () => {
|
||||||
|
process.env['RUNNER_TOOL_CACHE'] = __dirname;
|
||||||
|
await matchers.addMatchers();
|
||||||
|
const spy = jest.spyOn(io, 'cp');
|
||||||
|
expect(spy).toHaveBeenCalledTimes(2);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Test PHPUnit Regex', async () => {
|
||||||
|
const regex1 = /^\d+\)\s.*$/;
|
||||||
|
const regex2 = /^(.*Failed\sasserting\sthat.*)$/;
|
||||||
|
const regex3 = /^\s*$/;
|
||||||
|
const regex4 = /^(.*):(\d+)$/;
|
||||||
|
expect(regex1.test('1) Tests\\Test::it_tests')).toBe(true);
|
||||||
|
expect(regex2.test('Failed asserting that false is true')).toBe(true);
|
||||||
|
expect(regex3.test('\n')).toBe(true);
|
||||||
|
expect(regex4.test('/path/to/file.php:42')).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Test PHP Regex', async () => {
|
||||||
|
const regex1 = /^(.*error):\s+\s+(.+) in (.+) on line (\d+)$/;
|
||||||
|
const regex2 = /^(.*Warning|.*Deprecated|.*Notice):\s+\s+(.+) in (.+) on line (\d+)$/;
|
||||||
|
expect(
|
||||||
|
regex1.test('PHP Parse error: error_message in file.php on line 10')
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
regex2.test('PHP Notice: info_message in file.php on line 10')
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
regex2.test('PHP Warning: warning_message in file.php on line 10')
|
||||||
|
).toBe(true);
|
||||||
|
expect(
|
||||||
|
regex2.test('PHP Deprecated: deprecated_message in file.php on line 10')
|
||||||
|
).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,635 @@
|
|||||||
|
import * as tools from '../src/tools';
|
||||||
|
|
||||||
|
describe('Tools tests', () => {
|
||||||
|
it('checking parseToolVersion', async () => {
|
||||||
|
expect(await tools.getToolVersion('latest')).toBe('latest');
|
||||||
|
expect(await tools.getToolVersion('1.2.3')).toBe('1.2.3');
|
||||||
|
expect(await tools.getToolVersion('^1.2.3')).toBe('1.2.3');
|
||||||
|
expect(await tools.getToolVersion('>=1.2.3')).toBe('1.2.3');
|
||||||
|
expect(await tools.getToolVersion('>1.2.3')).toBe('1.2.3');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-ALPHA')).toBe('1.2.3-ALPHA');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-alpha')).toBe('1.2.3-alpha');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-beta')).toBe('1.2.3-beta');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-rc')).toBe('1.2.3-rc');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-dev')).toBe('1.2.3-dev');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-alpha1')).toBe('1.2.3-alpha1');
|
||||||
|
expect(await tools.getToolVersion('1.2.3-alpha.1')).toBe('1.2.3-alpha.1');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking parseToolVersion', async () => {
|
||||||
|
expect(await tools.parseTool('phpunit')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: 'latest'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:^1.2.3')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:>=1.2.3')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:>1.2.3')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-ALPHA')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-ALPHA'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-alpha')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-alpha'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-beta')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-beta'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-rc')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-rc'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-dev')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-dev'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-alpha1')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-alpha1'
|
||||||
|
});
|
||||||
|
expect(await tools.parseTool('phpunit:1.2.3-alpha.1')).toStrictEqual({
|
||||||
|
name: 'phpunit',
|
||||||
|
version: '1.2.3-alpha.1'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getUri', async () => {
|
||||||
|
expect(
|
||||||
|
await tools.getUri('tool', '.phar', 'latest', 'releases', '', 'download')
|
||||||
|
).toBe('releases/latest/download/tool.phar');
|
||||||
|
expect(
|
||||||
|
await tools.getUri('tool', '.phar', '1.2.3', 'releases', '', 'download')
|
||||||
|
).toBe('releases/download/1.2.3/tool.phar');
|
||||||
|
expect(
|
||||||
|
await tools.getUri('tool', '.phar', '1.2.3', 'releases', 'v', 'download')
|
||||||
|
).toBe('releases/download/v1.2.3/tool.phar');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getCodeceptionUriBuilder', async () => {
|
||||||
|
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php56')).toBe(
|
||||||
|
'releases/3.2.1/php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUriBuilder('3.2.1', 'php54')).toBe(
|
||||||
|
'releases/3.2.1/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUriBuilder('3.2.1', '')).toBe(
|
||||||
|
'releases/3.2.1/codecept.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getCodeceptionUri', async () => {
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '5.6')).toBe(
|
||||||
|
'php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '7.0')).toBe(
|
||||||
|
'php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '7.1')).toBe(
|
||||||
|
'php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '7.2')).toBe(
|
||||||
|
'codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '7.3')).toBe(
|
||||||
|
'codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('latest', '7.4')).toBe(
|
||||||
|
'codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('4.0.0', '7.4')).toBe(
|
||||||
|
'releases/4.0.0/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('4.0.0', '5.6')).toBe(
|
||||||
|
'releases/4.0.0/php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('4.0.0', '7.1')).toBe(
|
||||||
|
'releases/4.0.0/php56/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('3.1.0', '7.4')).toBe(
|
||||||
|
'releases/3.1.0/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('3.1.0', '5.6')).toBe(
|
||||||
|
'releases/3.1.0/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.5.4', '7.4')).toBe(
|
||||||
|
'releases/2.5.4/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.5.4', '5.6')).toBe(
|
||||||
|
'releases/2.5.4/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.3.4', '7.4')).toBe(
|
||||||
|
'releases/2.3.4/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.3.4', '5.4')).toBe(
|
||||||
|
'releases/2.3.4/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.2.4', '5.6')).toBe(
|
||||||
|
'releases/2.2.4/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.2.4', '7.4')).toBe(
|
||||||
|
'releases/2.2.4/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.2.4', '5.4')).toBe(
|
||||||
|
'releases/2.2.4/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.1.7', '5.6')).toBe(
|
||||||
|
'releases/2.1.7/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.1.7', '5.4')).toBe(
|
||||||
|
'releases/2.1.7/php54/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.1.5', '5.4')).toBe(
|
||||||
|
'releases/2.1.5/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('2.1.5', '7.4')).toBe(
|
||||||
|
'releases/2.1.5/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('1.6.9', '7.4')).toBe(
|
||||||
|
'releases/1.6.9/codecept.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getCodeceptionUri('1.5.0', '7.4')).toBe(
|
||||||
|
'releases/1.5.0/codecept.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addPhive', async () => {
|
||||||
|
let script: string = await tools.addPhive('1.2.3', 'linux');
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
|
||||||
|
);
|
||||||
|
|
||||||
|
script = await tools.addPhive('latest', 'win32');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://phar.io/releases/phive.phar phive'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getPharUri', async () => {
|
||||||
|
expect(await tools.getPharUrl('domain', 'tool', '', 'latest')).toBe(
|
||||||
|
'domain/tool.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getPharUrl('domain', 'tool', 'v', '1.2.3')).toBe(
|
||||||
|
'domain/tool-v1.2.3.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getDeployerUri', async () => {
|
||||||
|
expect(await tools.getDeployerUrl('latest')).toBe(
|
||||||
|
'https://deployer.org/deployer.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getDeployerUrl('1.2.3')).toBe(
|
||||||
|
'https://deployer.org/releases/v1.2.3/deployer.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addComposer', async () => {
|
||||||
|
expect(await tools.addComposer(['a', 'b'])).toStrictEqual([
|
||||||
|
'composer',
|
||||||
|
'a',
|
||||||
|
'b'
|
||||||
|
]);
|
||||||
|
expect(await tools.addComposer(['a', 'b', 'composer'])).toStrictEqual([
|
||||||
|
'composer',
|
||||||
|
'a',
|
||||||
|
'b'
|
||||||
|
]);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'composer:1.2.3'])
|
||||||
|
).toStrictEqual(['composer', 'a', 'b']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'composer:snapshot'])
|
||||||
|
).toStrictEqual(['composer:snapshot', 'a', 'b']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'composer:preview'])
|
||||||
|
).toStrictEqual(['composer:preview', 'a', 'b']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'c', 'composer:1'])
|
||||||
|
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'c', 'composer:2'])
|
||||||
|
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'c', 'composer:v1'])
|
||||||
|
).toStrictEqual(['composer:1', 'a', 'b', 'c']);
|
||||||
|
expect(
|
||||||
|
await tools.addComposer(['a', 'b', 'c', 'composer:v2'])
|
||||||
|
).toStrictEqual(['composer:2', 'a', 'b', 'c']);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getComposerUrl', async () => {
|
||||||
|
expect(await tools.getComposerUrl('latest')).toContain(
|
||||||
|
'https://getcomposer.org/composer-stable.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getComposerUrl('stable')).toContain(
|
||||||
|
'https://getcomposer.org/composer-stable.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getComposerUrl('snapshot')).toContain(
|
||||||
|
'https://getcomposer.org/composer.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getComposerUrl('preview')).toContain(
|
||||||
|
'https://getcomposer.org/composer-preview.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getComposerUrl('1')).toContain(
|
||||||
|
'https://getcomposer.org/composer-1.phar'
|
||||||
|
);
|
||||||
|
expect(await tools.getComposerUrl('2')).toContain(
|
||||||
|
'https://getcomposer.org/composer-2.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getSymfonyUri', async () => {
|
||||||
|
expect(await tools.getSymfonyUri('latest', 'linux')).toContain(
|
||||||
|
'releases/latest/download/symfony_linux_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('1.2.3', 'linux')).toContain(
|
||||||
|
'releases/download/v1.2.3/symfony_linux_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('latest', 'darwin')).toContain(
|
||||||
|
'releases/latest/download/symfony_darwin_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('1.2.3', 'darwin')).toContain(
|
||||||
|
'releases/download/v1.2.3/symfony_darwin_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('latest', 'win32')).toContain(
|
||||||
|
'releases/latest/download/symfony_windows_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('1.2.3', 'win32')).toContain(
|
||||||
|
'releases/download/v1.2.3/symfony_windows_amd64'
|
||||||
|
);
|
||||||
|
expect(await tools.getSymfonyUri('1.2.3', 'openbsd')).toContain(
|
||||||
|
'Platform openbsd is not supported'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getCleanedToolsList', async () => {
|
||||||
|
const tools_list: string[] = await tools.getCleanedToolsList(
|
||||||
|
'tool, composer:1.2.3, robmorgan/phinx, hirak/prestissimo, narrowspark/automatic-composer-prefetcher'
|
||||||
|
);
|
||||||
|
expect(tools_list).toStrictEqual([
|
||||||
|
'composer',
|
||||||
|
'tool',
|
||||||
|
'phinx',
|
||||||
|
'prestissimo',
|
||||||
|
'composer-prefetcher'
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getWpCliUri', async () => {
|
||||||
|
expect(await tools.getWpCliUrl('latest')).toBe(
|
||||||
|
'wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true'
|
||||||
|
);
|
||||||
|
expect(await tools.getWpCliUrl('2.4.0')).toBe(
|
||||||
|
'wp-cli/wp-cli/releases/download/v2.4.0/wp-cli-2.4.0.phar'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addArchive', async () => {
|
||||||
|
let script: string = await tools.addArchive(
|
||||||
|
'tool',
|
||||||
|
'https://tool.com/tool.phar',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
|
||||||
|
script = await tools.addArchive(
|
||||||
|
'tool',
|
||||||
|
'https://tool.com/tool.phar',
|
||||||
|
'darwin'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_tool https://tool.com/tool.phar tool');
|
||||||
|
script = await tools.addArchive(
|
||||||
|
'tool',
|
||||||
|
'https://tool.com/tool.phar',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Add-Tool https://tool.com/tool.phar tool');
|
||||||
|
|
||||||
|
script = await tools.addArchive(
|
||||||
|
'tool',
|
||||||
|
'https://tool.com/tool.phar',
|
||||||
|
'openbsd'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addDevTools', async () => {
|
||||||
|
let script: string = await tools.addDevTools('phpize', 'linux');
|
||||||
|
expect(script).toContain('add_devtools');
|
||||||
|
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
||||||
|
|
||||||
|
script = await tools.addDevTools('php-config', 'linux');
|
||||||
|
expect(script).toContain('add_devtools');
|
||||||
|
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
||||||
|
|
||||||
|
script = await tools.addDevTools('phpize', 'darwin');
|
||||||
|
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
||||||
|
|
||||||
|
script = await tools.addDevTools('php-config', 'darwin');
|
||||||
|
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
||||||
|
|
||||||
|
script = await tools.addDevTools('phpize', 'win32');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Log "$cross" "phpize" "phpize is not a windows tool"'
|
||||||
|
);
|
||||||
|
|
||||||
|
script = await tools.addDevTools('php-config', 'win32');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Log "$cross" "php-config" "php-config is not a windows tool"'
|
||||||
|
);
|
||||||
|
|
||||||
|
script = await tools.addDevTools('tool', 'openbsd');
|
||||||
|
expect(script).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addPackage', async () => {
|
||||||
|
let script: string = await tools.addPackage(
|
||||||
|
'tool',
|
||||||
|
'tool:1.2.3',
|
||||||
|
'user/',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
|
||||||
|
|
||||||
|
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'darwin');
|
||||||
|
expect(script).toContain('add_composertool tool tool:1.2.3 user/');
|
||||||
|
|
||||||
|
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'win32');
|
||||||
|
expect(script).toContain('Add-Composertool tool tool:1.2.3 user/');
|
||||||
|
|
||||||
|
script = await tools.addPackage('tool', 'tool:1.2.3', 'user/', 'openbsd');
|
||||||
|
expect(script).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking addTools on linux', async () => {
|
||||||
|
const script: string = await tools.addTools(
|
||||||
|
'blackfire, blackfire-player, cs2pr, flex, grpc_php_plugin, php-cs-fixer, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, php-config, phpize, protoc, symfony, wp-cli',
|
||||||
|
'7.4',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_blackfire');
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar php-cs-fixer'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar phpstan'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://www.phing.info/get/phing-latest.phar phing'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://phar.io/releases/phive.phar phive'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://phar.phpunit.de/phpunit.phar phpunit'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/symfony/cli/releases/latest/download/symfony_linux_amd64 symfony'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_protoc latest');
|
||||||
|
expect(script).toContain('add_grpc_php_plugin latest');
|
||||||
|
expect(script).toContain('add_pecl');
|
||||||
|
expect(script).toContain('add_composertool flex flex symfony/');
|
||||||
|
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
||||||
|
expect(script).toContain('add_composertool phplint phplint overtrue/');
|
||||||
|
expect(script).toContain('add_composertool phinx phinx:1.2.3 robmorgan/');
|
||||||
|
expect(script).toContain('add_devtools');
|
||||||
|
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
||||||
|
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
||||||
|
});
|
||||||
|
it('checking addTools on darwin', async () => {
|
||||||
|
const listOfTools = [
|
||||||
|
'blackfire',
|
||||||
|
'blackfire-player',
|
||||||
|
'composer-normalize',
|
||||||
|
'composer-prefetcher:1.2.3',
|
||||||
|
'composer-require-checker',
|
||||||
|
'composer-unused',
|
||||||
|
'cs2pr:1.2.3',
|
||||||
|
'flex',
|
||||||
|
'grpc_php_plugin:1.2.3',
|
||||||
|
'infection',
|
||||||
|
'phan',
|
||||||
|
'phan:2.7.2',
|
||||||
|
'phing:1.2.3',
|
||||||
|
'phinx',
|
||||||
|
'phive:1.2.3',
|
||||||
|
'php-config',
|
||||||
|
'phpcbf',
|
||||||
|
'phpcpd',
|
||||||
|
'phpcs',
|
||||||
|
'phpize',
|
||||||
|
'phpmd',
|
||||||
|
'protoc:v1.2.3',
|
||||||
|
'psalm',
|
||||||
|
'symfony',
|
||||||
|
'symfony:1.2.3',
|
||||||
|
'vapor-cli',
|
||||||
|
'wp-cli'
|
||||||
|
];
|
||||||
|
|
||||||
|
const script: string = await tools.addTools(
|
||||||
|
listOfTools.join(', '),
|
||||||
|
'7.4',
|
||||||
|
'darwin'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(script).toContain('add_blackfire');
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://get.blackfire.io/blackfire-player.phar blackfire-player'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/ergebnis/composer-normalize/releases/latest/download/composer-normalize.phar composer-normalize'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/maglnet/ComposerRequireChecker/releases/latest/download/composer-require-checker.phar composer-require-checker'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar composer-unused'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/download/1.2.3/cs2pr cs2pr'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/infection/infection/releases/latest/download/infection.phar infection'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phan/phan/releases/latest/download/phan.phar phan'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://www.phing.info/get/phing-1.2.3.phar phing'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcs.phar phpcs'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/squizlabs/PHP_CodeSniffer/releases/latest/download/phpcbf.phar phpcbf'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://phar.phpunit.de/phpcpd.phar phpcpd'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'https://github.com/vimeo/psalm/releases/latest/download/psalm.phar psalm'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_grpc_php_plugin 1.2.3');
|
||||||
|
expect(script).toContain('add_protoc 1.2.3');
|
||||||
|
expect(script).toContain('add_composertool vapor-cli vapor-cli laravel/');
|
||||||
|
expect(script).toContain('add_composertool flex flex symfony/');
|
||||||
|
expect(script).toContain('add_composertool phinx phinx robmorgan/');
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phan/phan/releases/download/2.7.2/phan.phar phan'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/phar-io/phive/releases/download/1.2.3/phive-1.2.3.phar phive'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_composertool composer-prefetcher composer-prefetcher:1.2.3 narrowspark/automatic-'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/symfony/cli/releases/latest/download/symfony_darwin_amd64 symfony'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/symfony/cli/releases/download/v1.2.3/symfony_darwin_amd64 symfony'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli'
|
||||||
|
);
|
||||||
|
expect(script).toContain('add_log "$tick" "phpize" "Added"');
|
||||||
|
expect(script).toContain('add_log "$tick" "php-config" "Added"');
|
||||||
|
});
|
||||||
|
it('checking addTools on windows', async () => {
|
||||||
|
const listOfTools = [
|
||||||
|
'blackfire',
|
||||||
|
'blackfire-player:1.8.1',
|
||||||
|
'codeception',
|
||||||
|
'cs2pr',
|
||||||
|
'deployer',
|
||||||
|
'does_not_exist',
|
||||||
|
'flex',
|
||||||
|
'phinx',
|
||||||
|
'phive:0.13.2',
|
||||||
|
'php-config',
|
||||||
|
'phpize',
|
||||||
|
'phpmd',
|
||||||
|
'prestissimo',
|
||||||
|
'symfony',
|
||||||
|
'wp-cli'
|
||||||
|
];
|
||||||
|
|
||||||
|
const script: string = await tools.addTools(
|
||||||
|
listOfTools.join(', '),
|
||||||
|
'7.4',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(script).toContain('Add-Blackfire');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://get.blackfire.io/blackfire-player-v1.8.1.phar blackfire-player'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr cs2pr'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Add-Composertool flex flex symfony/');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://deployer.org/deployer.phar deployer'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/phar-io/phive/releases/download/0.13.2/phive-0.13.2.phar phive'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/symfony/cli/releases/latest/download/symfony_windows_amd64.exe symfony'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli'
|
||||||
|
);
|
||||||
|
expect(script).toContain('phpize is not a windows tool');
|
||||||
|
expect(script).toContain('php-config is not a windows tool');
|
||||||
|
expect(script).toContain('Tool does_not_exist is not supported');
|
||||||
|
});
|
||||||
|
it('checking addTools with composer tool using user/tool as input', async () => {
|
||||||
|
const listOfTools = [
|
||||||
|
'hirak/prestissimo',
|
||||||
|
'narrowspark/automatic-composer-prefetcher',
|
||||||
|
'robmorgan/phinx'
|
||||||
|
];
|
||||||
|
|
||||||
|
const script: string = await tools.addTools(
|
||||||
|
listOfTools.join(', '),
|
||||||
|
'7.4',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-stable.phar,https://getcomposer.org/composer-stable.phar composer'
|
||||||
|
);
|
||||||
|
expect(script).toContain('Add-Composertool prestissimo prestissimo hirak/');
|
||||||
|
expect(script).toContain('Add-Composertool phinx phinx robmorgan/');
|
||||||
|
expect(script).toContain(
|
||||||
|
'Add-Composertool composer-prefetcher composer-prefetcher narrowspark/automatic-'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('checking composer setup', async () => {
|
||||||
|
const listOfTools = ['composer', 'composer:v1'];
|
||||||
|
|
||||||
|
let script: string = await tools.addTools(
|
||||||
|
listOfTools.join(', '),
|
||||||
|
'7.4',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-1.phar,https://getcomposer.org/composer-1.phar composer'
|
||||||
|
);
|
||||||
|
|
||||||
|
script = await tools.addTools('composer:preview', '7.4', 'linux');
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-preview.phar,https://getcomposer.org/composer-preview.phar composer'
|
||||||
|
);
|
||||||
|
script = await tools.addTools(
|
||||||
|
'composer:v1, composer:preview, composer:snapshot',
|
||||||
|
'7.4',
|
||||||
|
'linux'
|
||||||
|
);
|
||||||
|
expect(script).toContain(
|
||||||
|
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-snapshot.phar,https://getcomposer.org/composer.phar composer'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as utils from '../src/utils';
|
||||||
|
|
||||||
|
jest.mock('@actions/core', () => ({
|
||||||
|
getInput: jest.fn().mockImplementation(key => {
|
||||||
|
return ['setup-php'].indexOf(key) !== -1 ? key : '';
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
|
||||||
|
async function cleanup(path: string): Promise<void> {
|
||||||
|
fs.unlink(path, error => {
|
||||||
|
if (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('Utils tests', () => {
|
||||||
|
it('checking getInput', async () => {
|
||||||
|
process.env['test'] = 'setup-php';
|
||||||
|
process.env['undefined'] = '';
|
||||||
|
expect(await utils.getInput('test', false)).toBe('setup-php');
|
||||||
|
expect(await utils.getInput('undefined', false)).toBe('');
|
||||||
|
expect(await utils.getInput('setup-php', false)).toBe('setup-php');
|
||||||
|
expect(await utils.getInput('DoesNotExist', false)).toBe('');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking asyncForEach', async () => {
|
||||||
|
const array: Array<string> = ['a', 'b', 'c'];
|
||||||
|
let concat = '';
|
||||||
|
await utils.asyncForEach(array, async function (
|
||||||
|
str: string
|
||||||
|
): Promise<void> {
|
||||||
|
concat += str;
|
||||||
|
});
|
||||||
|
expect(concat).toBe('abc');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking asyncForEach', async () => {
|
||||||
|
expect(await utils.color('error')).toBe('31');
|
||||||
|
expect(await utils.color('success')).toBe('32');
|
||||||
|
expect(await utils.color('any')).toBe('32');
|
||||||
|
expect(await utils.color('warning')).toBe('33');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking readScripts', async () => {
|
||||||
|
const darwin: string = fs.readFileSync(
|
||||||
|
path.join(__dirname, '../src/scripts/darwin.sh'),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
const linux: string = fs.readFileSync(
|
||||||
|
path.join(__dirname, '../src/scripts/linux.sh'),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
const win32: string = fs.readFileSync(
|
||||||
|
path.join(__dirname, '../src/scripts/win32.ps1'),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
expect(await utils.readScript('darwin.sh')).toBe(darwin);
|
||||||
|
expect(await utils.readScript('darwin.sh')).toBe(darwin);
|
||||||
|
expect(await utils.readScript('linux.sh')).toBe(linux);
|
||||||
|
expect(await utils.readScript('linux.sh')).toBe(linux);
|
||||||
|
expect(await utils.readScript('win32.ps1')).toBe(win32);
|
||||||
|
expect(await utils.readScript('win32.ps1')).toBe(win32);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking writeScripts', async () => {
|
||||||
|
const testString = 'sudo apt-get install php';
|
||||||
|
const runner_dir: string = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||||
|
const script_path: string = path.join(runner_dir, 'test.sh');
|
||||||
|
await utils.writeScript('test.sh', testString);
|
||||||
|
await fs.readFile(script_path, function (
|
||||||
|
error: Error | null,
|
||||||
|
data: Buffer
|
||||||
|
) {
|
||||||
|
expect(testString).toBe(data.toString());
|
||||||
|
});
|
||||||
|
await cleanup(script_path);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking extensionArray', async () => {
|
||||||
|
expect(await utils.extensionArray('a, b, php_c, php-d')).toEqual([
|
||||||
|
'a',
|
||||||
|
'b',
|
||||||
|
'c',
|
||||||
|
'd'
|
||||||
|
]);
|
||||||
|
|
||||||
|
expect(await utils.extensionArray('')).toEqual([]);
|
||||||
|
expect(await utils.extensionArray(' ')).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking INIArray', async () => {
|
||||||
|
expect(await utils.CSVArray('a=1, b=2, c=3')).toEqual([
|
||||||
|
'a=1',
|
||||||
|
'b=2',
|
||||||
|
'c=3'
|
||||||
|
]);
|
||||||
|
expect(await utils.CSVArray('')).toEqual([]);
|
||||||
|
expect(await utils.CSVArray(' ')).toEqual([]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking log', async () => {
|
||||||
|
const message = 'Test message';
|
||||||
|
|
||||||
|
let warning_log: string = await utils.log(message, 'win32', 'warning');
|
||||||
|
expect(warning_log).toEqual('printf "\\033[33;1m' + message + ' \\033[0m"');
|
||||||
|
warning_log = await utils.log(message, 'linux', 'warning');
|
||||||
|
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
|
||||||
|
warning_log = await utils.log(message, 'darwin', 'warning');
|
||||||
|
expect(warning_log).toEqual('echo "\\033[33;1m' + message + '\\033[0m"');
|
||||||
|
|
||||||
|
let error_log: string = await utils.log(message, 'win32', 'error');
|
||||||
|
expect(error_log).toEqual('printf "\\033[31;1m' + message + ' \\033[0m"');
|
||||||
|
error_log = await utils.log(message, 'linux', 'error');
|
||||||
|
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
|
||||||
|
error_log = await utils.log(message, 'darwin', 'error');
|
||||||
|
expect(error_log).toEqual('echo "\\033[31;1m' + message + '\\033[0m"');
|
||||||
|
|
||||||
|
let success_log: string = await utils.log(message, 'win32', 'success');
|
||||||
|
expect(success_log).toEqual('printf "\\033[32;1m' + message + ' \\033[0m"');
|
||||||
|
success_log = await utils.log(message, 'linux', 'success');
|
||||||
|
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
|
||||||
|
success_log = await utils.log(message, 'darwin', 'success');
|
||||||
|
expect(success_log).toEqual('echo "\\033[32;1m' + message + '\\033[0m"');
|
||||||
|
|
||||||
|
let step_log: string = await utils.stepLog(message, 'win32');
|
||||||
|
expect(step_log).toEqual('Step-Log "Test message"');
|
||||||
|
step_log = await utils.stepLog(message, 'linux');
|
||||||
|
expect(step_log).toEqual('step_log "Test message"');
|
||||||
|
step_log = await utils.stepLog(message, 'darwin');
|
||||||
|
expect(step_log).toEqual('step_log "Test message"');
|
||||||
|
step_log = await utils.stepLog(message, 'openbsd');
|
||||||
|
expect(step_log).toContain('Platform openbsd is not supported');
|
||||||
|
|
||||||
|
let add_log: string = await utils.addLog(
|
||||||
|
'tick',
|
||||||
|
'xdebug',
|
||||||
|
'enabled',
|
||||||
|
'win32'
|
||||||
|
);
|
||||||
|
expect(add_log).toEqual('Add-Log "tick" "xdebug" "enabled"');
|
||||||
|
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'linux');
|
||||||
|
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
|
||||||
|
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'darwin');
|
||||||
|
expect(add_log).toEqual('add_log "tick" "xdebug" "enabled"');
|
||||||
|
add_log = await utils.addLog('tick', 'xdebug', 'enabled', 'openbsd');
|
||||||
|
expect(add_log).toContain('Platform openbsd is not supported');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getExtensionPrefix', async () => {
|
||||||
|
expect(await utils.getExtensionPrefix('extensionDoesNotExist')).toEqual(
|
||||||
|
'extension'
|
||||||
|
);
|
||||||
|
expect(await utils.getExtensionPrefix('xsl')).toEqual('extension');
|
||||||
|
expect(await utils.getExtensionPrefix('xdebug')).toEqual('zend_extension');
|
||||||
|
expect(await utils.getExtensionPrefix('xdebug3')).toEqual('zend_extension');
|
||||||
|
expect(await utils.getExtensionPrefix('opcache')).toEqual('zend_extension');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking suppressOutput', async () => {
|
||||||
|
expect(await utils.suppressOutput('win32')).toEqual(' >$null 2>&1');
|
||||||
|
expect(await utils.suppressOutput('linux')).toEqual(' >/dev/null 2>&1');
|
||||||
|
expect(await utils.suppressOutput('darwin')).toEqual(' >/dev/null 2>&1');
|
||||||
|
expect(await utils.suppressOutput('openbsd')).toContain(
|
||||||
|
'Platform openbsd is not supported'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getUnsupportedLog', async () => {
|
||||||
|
expect(await utils.getUnsupportedLog('ext', '5.6', 'linux')).toContain(
|
||||||
|
'add_log "$cross" "ext" "ext is not supported on PHP 5.6"'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking getCommand', async () => {
|
||||||
|
expect(await utils.getCommand('linux', 'tool')).toBe('add_tool ');
|
||||||
|
expect(await utils.getCommand('darwin', 'tool')).toBe('add_tool ');
|
||||||
|
expect(await utils.getCommand('win32', 'tool')).toBe('Add-Tool ');
|
||||||
|
expect(await utils.getCommand('openbsd', 'tool')).toContain(
|
||||||
|
'Platform openbsd is not supported'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking joins', async () => {
|
||||||
|
expect(await utils.joins('a', 'b', 'c')).toBe('a b c');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking scriptExtension', async () => {
|
||||||
|
expect(await utils.scriptExtension('linux')).toBe('.sh');
|
||||||
|
expect(await utils.scriptExtension('darwin')).toBe('.sh');
|
||||||
|
expect(await utils.scriptExtension('win32')).toBe('.ps1');
|
||||||
|
expect(await utils.scriptExtension('openbsd')).toContain(
|
||||||
|
'Platform openbsd is not supported'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking customPackage', async () => {
|
||||||
|
const script_path: string = path.join('ext', 'pkg.sh');
|
||||||
|
expect(await utils.customPackage('pkg', 'ext', '1.2.3', 'linux')).toContain(
|
||||||
|
script_path + '\nadd_pkg 1.2.3'
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
await utils.customPackage('pdo_pkg', 'ext', '1.2.3', 'linux')
|
||||||
|
).toContain(script_path + '\nadd_pkg 1.2.3');
|
||||||
|
expect(
|
||||||
|
await utils.customPackage('pkg8', 'ext', '1.2.3', 'linux')
|
||||||
|
).toContain(script_path + '\nadd_pkg 1.2.3');
|
||||||
|
});
|
||||||
|
});
|
||||||
+18
-4
@@ -1,12 +1,26 @@
|
|||||||
name: 'Setup PHP Action'
|
name: 'Setup PHP Action'
|
||||||
author: shivammathur
|
author: shivammathur
|
||||||
description: 'Setup a PHP environment with composer and add it to the PATH'
|
description: 'Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer'
|
||||||
branding:
|
branding:
|
||||||
icon: 'activity'
|
|
||||||
color: 'purple'
|
color: 'purple'
|
||||||
|
icon: 'play-circle'
|
||||||
inputs:
|
inputs:
|
||||||
php-version:
|
php-version:
|
||||||
description: 'PHP version to install.'
|
description: 'Setup PHP version.'
|
||||||
|
default: '7.4'
|
||||||
|
required: true
|
||||||
|
extensions:
|
||||||
|
description: 'Setup PHP extensions.'
|
||||||
|
required: false
|
||||||
|
ini-values:
|
||||||
|
description: 'Add values to php.ini.'
|
||||||
|
required: false
|
||||||
|
coverage:
|
||||||
|
description: 'Setup code coverage driver.'
|
||||||
|
required: false
|
||||||
|
tools:
|
||||||
|
description: 'Setup popular tools globally.'
|
||||||
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/install.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
Vendored
+3163
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
|||||||
# Contributors
|
|
||||||
|
|
||||||
Please submit a Pull Request to the develop branch
|
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# GitHub Action for roots/bedrock
|
||||||
|
name: Testing Bedrock
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
bedrock:
|
||||||
|
name: Bedrock (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.1', '7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: PHP test
|
||||||
|
run: composer test
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# GitHub Action for Blackfire Player
|
||||||
|
name: Play a Blackfire Scenario
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
blackfire-player:
|
||||||
|
name: Blackfire (PHP ${{ matrix.php-versions }})
|
||||||
|
# Add your Blackfire credentials securely using GitHub Secrets
|
||||||
|
env:
|
||||||
|
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
|
||||||
|
BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}
|
||||||
|
BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
|
||||||
|
BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
# blackfire-player supports PHP >= 5.5
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: blackfire
|
||||||
|
tools: blackfire, blackfire-player #Setup Blackfire client, agent and player
|
||||||
|
coverage: none
|
||||||
|
- name: Play the scenario
|
||||||
|
run: blackfire-player run scenario.bkf # Refer to https://blackfire.io/docs/player/index#usage
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
# GitHub Action for Blackfire
|
||||||
|
name: Profiling with blackfire
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
blackfire:
|
||||||
|
name: Blackfire (PHP ${{ matrix.php-versions }})
|
||||||
|
# Add your Blackfire credentials securely using GitHub Secrets
|
||||||
|
env:
|
||||||
|
BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
|
||||||
|
BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}
|
||||||
|
BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
|
||||||
|
BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
# Blackfire supports PHP >= 5.3 on ubuntu and macos and PHP >= 5.4 on windows
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: blackfire
|
||||||
|
tools: blackfire #Setup Blackfire client and agent
|
||||||
|
coverage: none
|
||||||
|
- name: Profile
|
||||||
|
run: blackfire run php my-script.php # Refer to https://blackfire.io/docs/cookbooks/profiling-cli
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
# GitHub Action for CakePHP with MySQL and Redis
|
||||||
|
# Tested with https://github.com/cakephp/app
|
||||||
|
name: Testing CakePHP with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: cakephp
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
# You can also use ext-apcu or ext-memcached instead of ext-redis
|
||||||
|
# Install memcached if using ext-memcached
|
||||||
|
extensions: mbstring, intl, redis, pdo_mysql
|
||||||
|
coverage: pcov
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer run-script post-install-cmd --no-interaction
|
||||||
|
# Add a step to run migrations if required
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
DB_DSN: "mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/cakephp?init[]=SET sql_mode = \"STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION\""
|
||||||
|
|
||||||
|
coding-standard:
|
||||||
|
name: Coding Standard
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: PHP CodeSniffer
|
||||||
|
run: composer cs-check
|
||||||
|
|
||||||
|
static-analysis:
|
||||||
|
name: Static Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
tools: phpstan
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Static Analysis using PHPStan
|
||||||
|
run: phpstan analyse --no-progress src/
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
# GitHub Action for CakePHP with PostgreSQL and Redis
|
||||||
|
# Tested with https://github.com/cakephp/app
|
||||||
|
name: Testing CakePHP with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
# You can also use ext-apcu or ext-memcached instead of ext-redis
|
||||||
|
# Install memcached if using ext-memcached
|
||||||
|
extensions: mbstring, intl, redis, pdo_pgsql
|
||||||
|
coverage: pcov
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer run-script post-install-cmd --no-interaction
|
||||||
|
# Add a step to run migrations if required
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
DB_DSN: postgres://postgres@127.0.0.1:${{ job.services.postgres.ports['5432'] }}/postgres
|
||||||
|
|
||||||
|
coding-standard:
|
||||||
|
name: Coding Standard
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: PHP CodeSniffer
|
||||||
|
run: composer cs-check
|
||||||
|
|
||||||
|
static-analysis:
|
||||||
|
name: Static Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
tools: phpstan
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Static Analysis using PHPStan
|
||||||
|
run: phpstan analyse --no-progress src/
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# GitHub Action for CakePHP
|
||||||
|
# Tested with https://github.com/cakephp/app
|
||||||
|
name: Testing CakePHP
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, intl, pdo_sqlite, pdo_mysql
|
||||||
|
coverage: pcov #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer run-script post-install-cmd --no-interaction
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
|
||||||
|
coding-standard:
|
||||||
|
name: Coding Standard
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: PHP CodeSniffer
|
||||||
|
run: composer cs-check
|
||||||
|
|
||||||
|
static-analysis:
|
||||||
|
name: Static Analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '7.3'
|
||||||
|
extensions: mbstring, intl
|
||||||
|
tools: phpstan
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Static Analysis using PHPStan
|
||||||
|
run: phpstan analyse --no-progress src/
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# GitHub Action for CodeIgniter
|
||||||
|
name: Testing CodeIgniter
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, intl, curl, dom
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# GitHub Action for Laravel with MySQL and Redis
|
||||||
|
name: Testing Laravel with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
laravel:
|
||||||
|
name: Laravel (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_DATABASE: laravel
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: password
|
||||||
|
BROADCAST_DRIVER: log
|
||||||
|
CACHE_DRIVER: redis
|
||||||
|
QUEUE_CONNECTION: redis
|
||||||
|
SESSION_DRIVER: redis
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: laravel
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, mysql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: |
|
||||||
|
php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
php artisan key:generate
|
||||||
|
- name: Clear Config
|
||||||
|
run: php artisan config:clear
|
||||||
|
- name: Run Migration
|
||||||
|
run: php artisan migrate -v
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# GitHub Action for Laravel with PostgreSQL and Redis
|
||||||
|
name: Testing Laravel with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
laravel:
|
||||||
|
name: Laravel (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
BROADCAST_DRIVER: log
|
||||||
|
CACHE_DRIVER: redis
|
||||||
|
QUEUE_CONNECTION: redis
|
||||||
|
SESSION_DRIVER: redis
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_PASSWORD: postgres
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_DATABASE: postgres
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, pgsql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: |
|
||||||
|
php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
php artisan key:generate
|
||||||
|
- name: Clear Config
|
||||||
|
run: php artisan config:clear
|
||||||
|
- name: Run Migration
|
||||||
|
run: php artisan migrate -v
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# GitHub Action for Laravel
|
||||||
|
name: Testing Laravel
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
laravel:
|
||||||
|
name: Laravel (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: |
|
||||||
|
php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
php artisan key:generate
|
||||||
|
- name: Clear Config
|
||||||
|
run: php artisan config:clear
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# GitHub Action for Lumen with MySQL and Redis
|
||||||
|
name: Testing Lumen with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
lumen:
|
||||||
|
name: Lumen (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_DATABASE: lumen
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: password
|
||||||
|
BROADCAST_DRIVER: log
|
||||||
|
CACHE_DRIVER: redis
|
||||||
|
QUEUE_CONNECTION: redis
|
||||||
|
SESSION_DRIVER: redis
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: lumen
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, mysql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer require predis/predis illuminate/redis
|
||||||
|
- name: Prepare the application
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
- name: Register Redis as service provider
|
||||||
|
run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php
|
||||||
|
- name: Run Migration
|
||||||
|
run: php artisan migrate -v
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# GitHub Action for Lumen with PostgreSQL and Redis
|
||||||
|
name: Testing Lumen with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
laravel:
|
||||||
|
name: Lumen (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
BROADCAST_DRIVER: log
|
||||||
|
CACHE_DRIVER: redis
|
||||||
|
QUEUE_CONNECTION: redis
|
||||||
|
SESSION_DRIVER: redis
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
DB_HOST: localhost
|
||||||
|
DB_PASSWORD: postgres
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_DATABASE: postgres
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
ports:
|
||||||
|
- 6379/tcp
|
||||||
|
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, pgsql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer require predis/predis illuminate/redis
|
||||||
|
- name: Prepare the application
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
- name: Register Redis as service provider
|
||||||
|
run: sed -i '$i\$app->register(Illuminate\\Redis\\RedisServiceProvider::class);' bootstrap/app.php
|
||||||
|
- name: Run Migration
|
||||||
|
run: php artisan migrate -v
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports[5432] }}
|
||||||
|
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# GitHub Action for Lumen
|
||||||
|
name: Unit Testing Lumen
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
lumen:
|
||||||
|
name: Lumen (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, fileinfo, mysql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
# GitHub Action for Phalcon with MySQL
|
||||||
|
## Notes
|
||||||
|
## Make sure you have .env.example or .env file in your project
|
||||||
|
## and you have loaded Dotenv (https://github.com/vlucas/phpdotenv)
|
||||||
|
name: Testing Phalcon with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
phalcon:
|
||||||
|
name: Phalcon (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_ADAPTER: mysql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_NAME: phalcon
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: password
|
||||||
|
CODECEPTION_URL: 127.0.0.1
|
||||||
|
CODECEPTION_PORT: 8888
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_DATABASE: phalcon
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
# For phalcon 3.x, use
|
||||||
|
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, zip, phalcon4, mysql #use phalcon3 for the phalcon 3.x.
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
- name: Run Migration
|
||||||
|
run: |
|
||||||
|
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
|
||||||
|
vendor/bin/phinx migrate
|
||||||
|
vendor/bin/phinx seed:run
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &)
|
||||||
|
vendor/bin/codecept build
|
||||||
|
vendor/bin/codecept run
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# GitHub Action for Phalcon with PostgreSQL
|
||||||
|
## Notes
|
||||||
|
## Make sure you have .env.example or .env file in your project
|
||||||
|
## and you have loaded Dotenv (https://github.com/vlucas/phpdotenv)
|
||||||
|
name: Testing Phalcon with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
phalcon:
|
||||||
|
name: Phalcon (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_ADAPTER: pgsql
|
||||||
|
DB_HOST: 127.0.0.1
|
||||||
|
DB_NAME: postgres
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_PASSWORD: postgres
|
||||||
|
CODECEPTION_URL: 127.0.0.1
|
||||||
|
CODECEPTION_PORT: 8888
|
||||||
|
DB_CONNECTION: pgsql
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
# For phalcon 3.x, use
|
||||||
|
# php-versions: ['7.0', '7.1', '7.2', '7.3']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, dom, zip, phalcon4, pgsql #use phalcon3 for the phalcon 3.x
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
|
||||||
|
- name: Run Migration
|
||||||
|
run: |
|
||||||
|
if [ ! -e phinx.yml ]; then vendor/bin/phinx init; fi
|
||||||
|
vendor/bin/phinx migrate
|
||||||
|
vendor/bin/phinx seed:run
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
(cd public && nohup php -S $CODECEPTION_URL:$CODECEPTION_PORT > phalcon.log 2>&1 &)
|
||||||
|
vendor/bin/codecept build
|
||||||
|
vendor/bin/codecept run
|
||||||
|
env:
|
||||||
|
DB_PORT: ${{ job.services.postgres.ports['5432'] }}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
# GitHub Action for roots/sage
|
||||||
|
name: Testing Sage
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
sage:
|
||||||
|
name: Sage (PHP ${{ matrix.php-versions }} & Node ${{ matrix.node-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.1', '7.2', '7.3', '7.4']
|
||||||
|
node-versions: ['8', '10']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-versions }}
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring
|
||||||
|
- name: Check node versions
|
||||||
|
run: node -v
|
||||||
|
- name: Get yarn cache
|
||||||
|
id: yarn-cache
|
||||||
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||||
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-yarn-
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install yarn dependencies
|
||||||
|
run: yarn -V
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Yarn test and build
|
||||||
|
run: |
|
||||||
|
yarn run test
|
||||||
|
yarn run build
|
||||||
|
yarn run rmdist
|
||||||
|
yarn run "build:production"
|
||||||
|
- name: PHP test
|
||||||
|
run: composer test
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# GitHub Action for Slim Framework
|
||||||
|
name: Testing Slim Framework
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, simplexml, dom
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# GitHub Action for Symfony with MySQL
|
||||||
|
name: Testing Symfony with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
symfony:
|
||||||
|
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: symfony
|
||||||
|
MYSQL_DATABASE: symfony
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Run Migration
|
||||||
|
run: |
|
||||||
|
composer require symfony/orm-pack
|
||||||
|
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
|
||||||
|
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
|
||||||
|
env:
|
||||||
|
DATABASE_URL: mysql://root:symfony@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony
|
||||||
|
- name: Run Tests
|
||||||
|
run: php bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# GitHub Action for Symfony with PostgreSQL
|
||||||
|
name: Testing Symfony with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
symfony:
|
||||||
|
name: Symfony (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Run Migration
|
||||||
|
run: |
|
||||||
|
composer require symfony/orm-pack
|
||||||
|
php bin/console doctrine:schema:update --force || echo "No migrations found or schema update failed"
|
||||||
|
php bin/console doctrine:migrations:migrate || echo "No migrations found or migration failed"
|
||||||
|
env:
|
||||||
|
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:${{ job.services.postgres.ports[5432] }}/postgres?charset=UTF-8
|
||||||
|
- name: Run Tests
|
||||||
|
run: php bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# GitHub Action for Symfony
|
||||||
|
name: Testing Symfony
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
symfony:
|
||||||
|
name: Symfony (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: |
|
||||||
|
composer require symfony/orm-pack
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Run Tests
|
||||||
|
run: php bin/phpunit --coverage-text
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
# GitHub Action for Yii Framework with MySQL
|
||||||
|
name: Testing Yii2 with MySQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
yii:
|
||||||
|
name: Yii2 (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: yii
|
||||||
|
TEST_DB_USERNAME: root
|
||||||
|
TEST_DB_PASSWORD: yii
|
||||||
|
DB_CHARSET: utf8
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
env:
|
||||||
|
MYSQL_ALLOW_EMPTY_PASSWORD: false
|
||||||
|
MYSQL_ROOT_PASSWORD: yii
|
||||||
|
MYSQL_DATABASE: yii
|
||||||
|
ports:
|
||||||
|
- 3306/tcp
|
||||||
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set Node.js 10.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, intl, gd, imagick, zip, dom, mysql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Start mysql service
|
||||||
|
run: sudo /etc/init.d/mysql start
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: |
|
||||||
|
php -r "file_exists('.env') || copy('.env.dist', '.env');"
|
||||||
|
php console/yii app/setup
|
||||||
|
npm install --development
|
||||||
|
npm run build
|
||||||
|
env:
|
||||||
|
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||||
|
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
vendor/bin/codecept build
|
||||||
|
php tests/bin/yii app/setup --interactive=0
|
||||||
|
nohup php -S localhost:8080 > yii.log 2>&1 &
|
||||||
|
vendor/bin/codecept run
|
||||||
|
env:
|
||||||
|
DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||||
|
TEST_DB_DSN: mysql:host=127.0.0.1;port=${{ job.services.mysql.ports['3306'] }};dbname=yii
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
# GitHub Action for Yii Framework with PostgreSQL
|
||||||
|
name: Testing Yii2 with PostgreSQL
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
yii:
|
||||||
|
name: Yii2 (PHP ${{ matrix.php-versions }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
DB_USERNAME: postgres
|
||||||
|
DB_PASSWORD: postgres
|
||||||
|
TEST_DB_USERNAME: postgres
|
||||||
|
TEST_DB_PASSWORD: postgres
|
||||||
|
DB_CHARSET: utf8
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:10.8
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
ports:
|
||||||
|
- 5432/tcp
|
||||||
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set Node.js 10.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 10.x
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, intl, gd, imagick, zip, dom, pgsql
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install Composer dependencies
|
||||||
|
run: composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
- name: Prepare the application
|
||||||
|
run: |
|
||||||
|
php -r "file_exists('.env') || copy('.env.dist', '.env');"
|
||||||
|
php console/yii app/setup
|
||||||
|
npm install --development
|
||||||
|
npm run build
|
||||||
|
env:
|
||||||
|
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||||
|
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||||
|
- name: Run Tests
|
||||||
|
run: |
|
||||||
|
vendor/bin/codecept build
|
||||||
|
php tests/bin/yii app/setup --interactive=0
|
||||||
|
nohup php -S localhost:8080 > yii.log 2>&1 &
|
||||||
|
vendor/bin/codecept run
|
||||||
|
env:
|
||||||
|
DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||||
|
TEST_DB_DSN: pgsql:host=127.0.0.1;port=${{ job.services.postgres.ports['5432'] }};dbname=postgres
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# GitHub Action for Zend Framework
|
||||||
|
name: Testing Zend Framework
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
operating-system: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
|
php-versions: ['7.2', '7.3', '7.4']
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Setup PHP, with composer and extensions
|
||||||
|
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
|
||||||
|
with:
|
||||||
|
php-version: ${{ matrix.php-versions }}
|
||||||
|
extensions: mbstring, bcmath, curl, intl
|
||||||
|
coverage: xdebug #optional
|
||||||
|
- name: Get composer cache directory
|
||||||
|
id: composercache
|
||||||
|
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
|
- name: Cache composer dependencies
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ${{ steps.composercache.outputs.dir }}
|
||||||
|
# Use composer.json for key, if composer.lock is not committed.
|
||||||
|
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
|
||||||
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
restore-keys: ${{ runner.os }}-composer-
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test
|
||||||
|
- name: Test with phpunit
|
||||||
|
run: vendor/bin/phpunit --coverage-text
|
||||||
+3
-2
@@ -7,5 +7,6 @@ module.exports = {
|
|||||||
transform: {
|
transform: {
|
||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
verbose: true
|
verbose: true,
|
||||||
}
|
collectCoverage: true
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
||||||
result["default"] = mod;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const core = __importStar(require("@actions/core"));
|
|
||||||
const exec_1 = require("@actions/exec/lib/exec");
|
|
||||||
var https = require('https');
|
|
||||||
const fs = require('fs');
|
|
||||||
function get_file(filename) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let github_path = 'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/';
|
|
||||||
const file = fs.createWriteStream(filename);
|
|
||||||
const request = https.get(github_path + filename, function (response) {
|
|
||||||
response.pipe(file);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function run() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
|
||||||
let version = process.env['php-version'];
|
|
||||||
if (!version) {
|
|
||||||
version = core.getInput('php-version', { required: true });
|
|
||||||
}
|
|
||||||
console.log('Input: ' + version);
|
|
||||||
let os_version = process.platform;
|
|
||||||
if (os_version == 'darwin') {
|
|
||||||
yield get_file('darwin.sh');
|
|
||||||
yield exec_1.exec('sudo chmod a+x darwin.sh');
|
|
||||||
yield exec_1.exec('./darwin.sh ' + version);
|
|
||||||
}
|
|
||||||
else if (os_version == 'win32') {
|
|
||||||
yield get_file('windows.ps1');
|
|
||||||
yield exec_1.exec('DIR');
|
|
||||||
yield exec_1.exec('powershell .\\windows.ps1 -version ' + version);
|
|
||||||
}
|
|
||||||
else if (os_version == 'linux') {
|
|
||||||
yield get_file('linux.sh');
|
|
||||||
yield exec_1.exec('sudo chmod a+x linux.sh');
|
|
||||||
yield exec_1.exec('./linux.sh ' + version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
core.setFailed(err.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
run().then(() => {
|
|
||||||
console.log('done');
|
|
||||||
});
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
||||||
result["default"] = mod;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const core = __importStar(require("@actions/core"));
|
|
||||||
const exec_1 = require("@actions/exec/lib/exec");
|
|
||||||
var https = require('https');
|
|
||||||
const fs = require('fs');
|
|
||||||
function get_file(filename) {
|
|
||||||
let github_path = 'https://raw.githubusercontent.com/shivammathur/setup-php/develop/src/';
|
|
||||||
const file = fs.createWriteStream(filename);
|
|
||||||
const request = https.get(github_path + filename, function (response) {
|
|
||||||
response.pipe(file);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function run() {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
|
||||||
const version = core.getInput('php-version', { required: true });
|
|
||||||
console.log('Input: ' + version);
|
|
||||||
let os_version = process.platform;
|
|
||||||
if (os_version == 'darwin') {
|
|
||||||
get_file('darwin.sh');
|
|
||||||
yield exec_1.exec('sudo chmod a+x darwin.sh');
|
|
||||||
yield exec_1.exec('./darwin.sh ' + version);
|
|
||||||
}
|
|
||||||
else if (os_version == 'win32') {
|
|
||||||
get_file('windows.ps1');
|
|
||||||
yield exec_1.exec('powershell windows.ps1 -version ' + version);
|
|
||||||
}
|
|
||||||
else if (os_version == 'linux') {
|
|
||||||
get_file('linux.sh');
|
|
||||||
yield exec_1.exec('sudo chmod a+x linux.sh');
|
|
||||||
yield exec_1.exec('./linux.sh ' + version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
core.setFailed(err.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
run().then(() => {
|
|
||||||
console.log('done');
|
|
||||||
});
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
let v = process.env['php-version'];
|
|
||||||
console.log(v);
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../acorn/bin/acorn" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\acorn\bin\acorn" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\acorn\bin\acorn" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../atob/bin/atob.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../atob/bin/atob.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\atob\bin\atob.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\atob\bin\atob.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../escodegen/bin/escodegen.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../escodegen/bin/escodegen.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\escodegen\bin\escodegen.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\escodegen\bin\escodegen.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../escodegen/bin/esgenerate.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../escodegen/bin/esgenerate.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\escodegen\bin\esgenerate.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\escodegen\bin\esgenerate.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../esprima/bin/esparse.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\esprima\bin\esparse.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\esprima\bin\esparse.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../esprima/bin/esvalidate.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\esprima\bin\esvalidate.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\esprima\bin\esvalidate.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../handlebars/bin/handlebars" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../handlebars/bin/handlebars" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\handlebars\bin\handlebars" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\handlebars\bin\handlebars" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../husky/lib/upgrader/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../husky/lib/upgrader/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\husky\lib\upgrader\bin.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\husky\lib\upgrader\bin.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../import-local/fixtures/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../import-local/fixtures/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\import-local\fixtures\cli.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\import-local\fixtures\cli.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../is-ci/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../is-ci/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\is-ci\bin.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\is-ci\bin.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../jest/bin/jest.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../jest/bin/jest.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../jest-runtime/bin/jest-runtime.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../jest-runtime/bin/jest-runtime.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\jest-runtime\bin\jest-runtime.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\jest-runtime\bin\jest-runtime.js" %*
|
|
||||||
)
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\jest\bin\jest.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\jest\bin\jest.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../js-yaml/bin/js-yaml.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\js-yaml\bin\js-yaml.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\js-yaml\bin\js-yaml.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../jsesc/bin/jsesc" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\jsesc\bin\jsesc" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\jsesc\bin\jsesc" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../json5/lib/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\json5\lib\cli.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\json5\lib\cli.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../loose-envify/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\loose-envify\cli.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\loose-envify\cli.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../mkdirp/bin/cmd.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\mkdirp\bin\cmd.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\mkdirp\bin\cmd.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../@babel/parser/bin/babel-parser.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\@babel\parser\bin\babel-parser.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../prettier/bin-prettier.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../prettier/bin-prettier.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\prettier\bin-prettier.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\prettier\bin-prettier.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../rimraf/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../rimraf/bin.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\rimraf\bin.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\rimraf\bin.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/bash" ]; then
|
|
||||||
"$basedir/bash" "$basedir/../run-node/run-node" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
bash "$basedir/../run-node/run-node" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\bash.exe" (
|
|
||||||
"%~dp0\bash.exe" "%~dp0\..\run-node\run-node" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
bash "%~dp0\..\run-node\run-node" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../sane/src/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../sane/src/cli.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\sane\src\cli.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\sane\src\cli.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../semver/bin/semver.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\semver\bin\semver.js" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\semver\bin\semver.js" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../sshpk/bin/sshpk-conv" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
@IF EXIST "%~dp0\node.exe" (
|
|
||||||
"%~dp0\node.exe" "%~dp0\..\sshpk\bin\sshpk-conv" %*
|
|
||||||
) ELSE (
|
|
||||||
@SETLOCAL
|
|
||||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
node "%~dp0\..\sshpk\bin\sshpk-conv" %*
|
|
||||||
)
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../sshpk/bin/sshpk-sign" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user