-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (69 loc) · 1.85 KB
/
code-test.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
name: Testing
on:
workflow_call:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
static-scan-phase:
name: Static Scanning
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: php-actions/composer@v6
- name: Scanning
uses: php-actions/phpstan@v3
with:
path: app/ tests/
level: 0
secret-scan-phase:
name: Secret Scanning
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: GitGuardian scan
uses: GitGuardian/[email protected]
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
test-phase:
name: Run PHPUnit
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: php-actions/composer@v6
- uses: php-actions/phpunit@v3
with:
memory_limit: "512M"
bootstrap: vendor/autoload.php
configuration: ./phpunit.xml
version: "10"
php_version: "8.2"
build:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
tags: test-build-image