-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.57 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Test
permissions: read-all
on:
push:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-no-composer-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.
- run: |
# Verify that PHP is available
if ! command -v php; then
echo "PHP is not available"
exit 1
fi
# Verify composer made it too.
if ! command -v composer; then
echo "Composer is not available"
exit 1
fi
# PHP Version is 8.3 or greater
if [ "$(php -r 'echo PHP_VERSION_ID;')" -lt 80300 ]; then
echo "PHP Version is less than 8.3"
exit 1
fi
test-with-composer-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
echo '{"require": {"php": "=7.4"}}' > composer.json
- uses: ./.
- run: |
# Verify that PHP is available
if ! command -v php; then
echo "PHP is not available"
exit 1
fi
# Verify composer made it too.
if ! command -v composer; then
echo "Composer is not available"
exit 1
fi
# PHP Version is equal to 7.4
if [ "$(php -r 'echo PHP_VERSION_ID;')" -gte 70400 && "$(php -r 'echo PHP_VERSION_ID;')" -lt 70500 ]; then
echo "PHP Version is not 7.4. Got $(php -r 'echo PHP_VERSION_ID;') instead of between 70400-70500"
exit 1
fi