-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.23 KB
/
Copy pathci.yml
File metadata and controls
44 lines (37 loc) · 1.23 KB
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
name: CI
on: [push, pull_request]
jobs:
build:
name: Lint & Validate
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.1", "8.3", "8.4"]
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json
- name: Syntax check
run: find src -name "*.php" -exec php -l {} \;
- name: Validate composer.json
run: composer validate --strict
- name: Install autoloader
run: composer install --no-interaction
- name: Smoke test
run: |
php -r '
require "vendor/autoload.php";
$mail = new \ZeroDrop\Client();
$inbox = $mail->generateInbox();
if (!preg_match("/^[a-z]+-[a-z0-9]{7}@zerodrop-sandbox\.online$/", $inbox)) {
throw new \Exception("bad inbox: " . $inbox);
}
$f = new \ZeroDrop\Filter(hasOtp: true);
$email = \ZeroDrop\Email::fromArray(["otp" => "123456", "from" => "a@b.c"]);
if (!$f->matches($email)) {
throw new \Exception("filter broken");
}
echo "smoke test passed: " . $inbox . PHP_EOL;
'