-
Notifications
You must be signed in to change notification settings - Fork 17
103 lines (87 loc) · 3.15 KB
/
method_sync_tests.yml
File metadata and controls
103 lines (87 loc) · 3.15 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
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
93
94
95
96
97
98
99
100
101
102
103
name: "Method_sync_test"
on:
schedule:
- cron: "0 4 * * *" # kvuli tomu ze GH funguje na UTC, tak se test spousi ve 4 (nas cas 6:00)
workflow_dispatch:
env:
extensions: "json, xdebug"
cache-version: "1"
composer-version: "v2"
composer-install: "composer install --no-interaction --no-progress --prefer-dist"
coverage: "xdebug"
jobs:
tests:
if: github.ref == 'refs/heads/master'
name: "Method_sync_test"
runs-on: "${{ matrix.operating-system }}"
strategy:
matrix:
php-version: ["8.5"]
operating-system: ["ubuntu-latest"]
composer-args: [ "" ]
fail-fast: false
steps:
- name: Checkout PR head (fork code)
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
- name: "Setup PHP cache environment"
id: "extcache"
uses: "shivammathur/cache-extensions@v1"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
key: "${{ env.cache-version }}"
- name: "Cache PHP extensions"
uses: "actions/cache@v4"
with:
path: "${{ steps.extcache.outputs.dir }}"
key: "${{ steps.extcache.outputs.key }}"
restore-keys: "${{ steps.extcache.outputs.key }}"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.extensions }}"
tools: "composer:${{ env.composer-version }}"
coverage: "${{ env.coverage }}"
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Setup problem matchers for PHP"
run: 'echo "::add-matcher::${{ runner.tool_cache }}/php.json"'
- name: "Get Composer cache directory"
id: "composercache"
run: 'echo "::set-output name=dir::$(composer config cache-files-dir)"'
- name: "Cache PHP dependencies"
uses: "actions/cache@v4"
with:
path: "${{ steps.composercache.outputs.dir }}"
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}"
restore-keys: "${{ runner.os }}-composer-"
- name: "Install dependencies"
run: "${{ env.composer-install }}"
# for building codecept i need .env
- name: "Env variables"
run: |
touch .env
- name: "Build Codeception actors"
run: "vendor/bin/codecept build -v"
- name: "Regenerate autoloader"
run: "composer dump-autoload --optimize"
- name: Run Codeception Tests
run: |
vendor/bin/codecept run --group=method-sync
- name: IP check on Failure
if: ${{ failure() }}
run: |
RUNNER_IP=$(curl -s https://api.ipify.org/)
echo "::warning::Test execution failed. This might be a network or IP whitelisting issue."
echo "::warning::The public IP of the GitHub runner was: ${RUNNER_IP}"
echo "::warning::Please ensure this IP is whitelisted."
- name: "Upload test output"
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: output
path: tests/**/output