-
Notifications
You must be signed in to change notification settings - Fork 28
62 lines (49 loc) · 1.86 KB
/
run-tests.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
name: Tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: ["8.1", "8.2", "8.3"]
stability: [--prefer-lowest, --prefer-stable]
env:
PHP_VERSION: ${{ matrix.php }}
DEPS_STRATEGY: ${{ matrix.stability }}
name: PHP${{ matrix.php }} ${{ matrix.stability }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: masesgroup/retrieve-changed-files@v3
id: files
continue-on-error: true
- name: Setup spellcheker dependencies
run: make pull
- name: Define folders which changes within requires docker build step
run: echo "FILES_REQUIRING_DOCKER_BUILD=php/Dockerfile" >> $GITHUB_ENV
- name: Build docker images
run: make build
if: contains(steps.files.outputs.all, env.FILES_REQUIRING_DOCKER_BUILD)
- name: Login to Docker Hub
uses: docker/login-action@v3
if: contains(steps.files.outputs.all, env.FILES_REQUIRING_DOCKER_BUILD)
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Push docker image
run: make push
if: contains(steps.files.outputs.all, env.FILES_REQUIRING_DOCKER_BUILD)
- name: Run tests
run: |
export WITH_COVERAGE=$(if [[ ("${{ matrix.php }}" = "8.3") && ("${{ matrix.stability }}" = "--prefer-stable") ]]; then echo "true"; else echo "false"; fi)
echo "WITH_COVERAGE=${WITH_COVERAGE}" >> $GITHUB_ENV
make vendor
make tests
- name: Run examples
run: make examples-test
- uses: codecov/codecov-action@v4
if: env.WITH_COVERAGE == 'true'
with:
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}