-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (90 loc) · 2.5 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Test
on:
push:
env:
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
jobs:
unit:
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Install Dependencies
run: |
composer install
- name: Unit Tests
run: composer test
terminus-3:
needs: unit
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.3]
name: Terminus 3 Functional Tests
env:
TERMINUS_SITE: terminus-addons-installer-plugin
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }}
BUILD_NUM: ${{ github.run_number }}
PHP_VERSION: ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Terminus
run: |
echo "💻 Installing Terminus from phar on Linux..."
curl -L "https://github.com/pantheon-systems/terminus/releases/latest/download/terminus.phar" -o terminus
chmod +x terminus
sudo mv terminus /usr/local/bin/
# Test that terminus works...
terminus --version
- name: Install SSH key
uses: webfactory/ssh-agent@d4b9b8ff72958532804b70bbe600ad43b36d5f2e
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
log-public-key: false
- name: Set up environment
run: ./.bin/setup.sh
- name: Install plugin
run: |
terminus self:plugin:install ${GITHUB_WORKSPACE}
if [[ "${{ matrix.php }}" == "7.4" ]]; then
composer update
fi
composer install
- name: Install BATS
uses: mig4/setup-bats@v1
- name: Functional Tests
run: composer functional
- name: Cleanup
if: always()
run: ./.bin/cleanup.sh
code-style:
name: Code Style
runs-on: ubuntu-latest
strategy:
matrix:
php: [7.4, 8.3]
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
if [[ "${{ matrix.php }}" == "7.4" ]]; then
composer update
fi
composer install
- name: Code Style
run: composer lint