-
Notifications
You must be signed in to change notification settings - Fork 74
115 lines (111 loc) · 2.94 KB
/
main.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
- "9.0"
jobs:
# Unit tests back (phpunit)
laravel-tests:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 8.2
env:
LARAVEL: 11.*
TESTBENCH: 9.*
- php: 8.3
env:
LARAVEL: 11.*
TESTBENCH: 9.*
env: ${{ matrix.env }}
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, dom, fileinfo, mysql
- name: Setup locales
run: sudo locale-gen fr_FR.UTF-8
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${LARAVEL}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update
composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute tests via Pest
run: ./vendor/bin/pest --parallel
# Front unit tests
# front-tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '14'
#
# - name: Update NPM
# run: npm i -g npm@9
#
# - name: Install front dependencies
# run: npm ci
#
# - name: Run Front tests
# run: npm run test
# Front e2e tests
# e2e-tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '14'
#
# - name: Update NPM
# run: npm i -g npm@9
#
# - name: Install sharp dependencies
# run: npm ci --production
#
# - name: Run E2E tests
# uses: cypress-io/github-action@v2
# with:
# command: npm run cy:run-ct
# working-directory: tests-e2e
# env: CI=true
#
# - uses: actions/upload-artifact@v4
# if: always()
# continue-on-error: true
# with:
# name: e2e-cypress-screenshots
# path: tests-e2e/cypress/screenshots
slack:
needs:
- laravel-tests
# - e2e-tests
if: failure() && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: 8398a7/[email protected]
with:
status: failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}