-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (90 loc) · 2.43 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 'Testing'
on:
push:
branches:
- "**"
permissions:
id-token: write
contents: read
jobs:
hadolint:
runs-on: ubuntu-latest
container:
image: hadolint/hadolint:latest-debian
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Hadolinting
run: |
hadolint Dockerfile || true
hadolint prebuild.Dockerfile || true
pylint:
runs-on: ubuntu-latest
container:
image: python:3.10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies pip
run: pip install --no-cache-dir --upgrade pip pipenv
- name: Install dep pipenv
run: pipenv install --system --dev --deploy
- name: Install Pylint
run: pip install pylint
- name: Pylinting
run: pylint --recursive=y .
semgrep:
runs-on: ubuntu-latest
container:
image: registry.gitlab.com/security-products/semgrep:4
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4
- name: Scan
run: semgrep scan --config=auto --output semgrep.json --json
- name: Upload scan report
uses: actions/upload-artifact@v4
with:
name: scan-report-semgrep
path: semgrep.json
run_django_tests:
runs-on: ubuntu-latest
container:
image: python:3.10
env:
# django vars
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: postgres
SECRET_KEY: DUMMYSECRETKEYVALUE
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PORT: 5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies pip
run: pip install --no-cache-dir --upgrade pip pipenv
- name: Install dep pipenv
run: pipenv install --system --dev --deploy
- name: Pytest
run: pytest
- name: Manage check
run: python manage.py check -v 3