forked from ledgerleapllc/CasperAssociationPortalBackend
-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (41 loc) · 1.43 KB
/
laravel.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
name: Laravel
on:
- pull_request
- push
jobs:
laravel-tests:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:7.4
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
coverage: xdebug
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Directory Permissions
run: |
chmod -R 777 storage bootstrap/cache &&\
chmod -R 777 public/documents
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- name: Fix code coverage paths
run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}