File tree Expand file tree Collapse file tree 6 files changed +35
-68
lines changed Expand file tree Collapse file tree 6 files changed +35
-68
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,23 @@ jobs:
11
11
steps :
12
12
-
13
13
name : Checkout
14
- uses : actions/checkout@v2
14
+ uses : actions/checkout@v3
15
15
-
16
16
name : Set up QEMU
17
- uses : docker/setup-qemu-action@v1
17
+ uses : docker/setup-qemu-action@v2
18
18
-
19
19
name : Set up Docker Buildx
20
- uses : docker/setup-buildx-action@v1
20
+ uses : docker/setup-buildx-action@v2
21
21
-
22
22
name : Login to DockerHub
23
- uses : docker/login-action@v1
23
+ uses : docker/login-action@v2
24
24
with :
25
25
username : ${{ secrets.DOCKER_USERNAME }}
26
26
password : ${{ secrets.DOCKER_TOKEN }}
27
27
-
28
28
name : Build and push
29
29
id : docker_build
30
- uses : docker/build-push-action@v2
30
+ uses : docker/build-push-action@v4
31
31
with :
32
32
push : true
33
33
context : .
Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ jobs:
10
10
steps :
11
11
-
12
12
name : Checkout
13
- uses : actions/checkout@v2
13
+ uses : actions/checkout@v3
14
14
-
15
15
name : Set up QEMU
16
- uses : docker/setup-qemu-action@v1
16
+ uses : docker/setup-qemu-action@v2
17
17
-
18
18
name : Set up Docker Buildx
19
- uses : docker/setup-buildx-action@v1
19
+ uses : docker/setup-buildx-action@v2
20
20
-
21
21
name : Login to DockerHub
22
- uses : docker/login-action@v1
22
+ uses : docker/login-action@v2
23
23
with :
24
24
username : ${{ secrets.DOCKER_USERNAME }}
25
25
password : ${{ secrets.DOCKER_TOKEN }}
36
36
-
37
37
name : Build and push release
38
38
id : docker_build
39
- uses : docker/build-push-action@v2
39
+ uses : docker/build-push-action@v4
40
40
with :
41
41
push : true
42
42
context : .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- name : Unit Tests
1
+ name : Tests
2
2
3
3
on :
4
4
push :
7
7
branches : [ master ]
8
8
9
9
jobs :
10
- container-job :
10
+ build :
11
11
runs-on : ubuntu-latest
12
-
12
+ strategy :
13
+ matrix :
14
+ os : ['ubuntu-latest', 'mac-latest']
15
+ python-version : ['3.10', '3.11']
13
16
services :
14
17
postgres :
15
- image : postgres
18
+ image : postgres:12
16
19
env :
17
20
POSTGRES_PASSWORD : postgres
21
+ POSTGRES_DB : nodejsscan
18
22
options : >-
19
23
--health-cmd pg_isready
20
24
--health-interval 10s
@@ -25,24 +29,27 @@ jobs:
25
29
26
30
steps :
27
31
- uses : actions/checkout@v3
28
- - name : Set up Python3
32
+ - name : Set up Python ${{ matrix.python-version }}
29
33
uses : actions/setup-python@v3
30
-
34
+ with :
35
+ python-version : ${{ matrix.python-version }}
31
36
- name : Install dependencies
32
37
run : |
33
- python -m pip install --upgrade pip tox
38
+ python -m pip install --upgrade pip tox pytest
34
39
pip install -r requirements.txt
35
40
36
- - name : Run tests
41
+ - name : Lint
42
+ run : |
43
+ tox -e lint
44
+
45
+ - name : Bandit
46
+ run : |
47
+ tox -e bandit
48
+
49
+ - name : Tests
37
50
run : |
38
51
tox -e py
39
- env :
40
- POSTGRES_HOST : postgres
41
- POSTGRES_PASSWORD : postgres
42
- POSTGRES_PORT : 5432
43
- POSTGRES_DB : nodejsscan
44
- SQLALCHEMY_DATABASE_URI : postgresql://postgres:postgres@localhost/nodejsscan
45
52
46
53
- name : Clean Up
47
54
run : |
48
- tox -e clean
55
+ tox -e clean
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ def setUp(self):
29
29
"""Executed prior to each test."""
30
30
app .config ['TESTING' ] = True
31
31
app .config ['DEBUG' ] = True
32
- app .config ['SQLALCHEMY_DATABASE_URI' ] = 'sqlite:///tmp/test.db'
33
32
app .app_context ().push ()
34
33
db .create_all ()
35
34
self .app = app .test_client ()
Original file line number Diff line number Diff line change @@ -3,9 +3,12 @@ envlist = py37, py38
3
3
skipsdist = True
4
4
5
5
[testenv]
6
+ # Needs postgres, works only in Github actions
6
7
deps =
7
8
-rrequirements.txt
8
9
pytest
10
+ setenv =
11
+ SQLALCHEMY_DATABASE_URI = postgresql://postgres:postgres@localhost:5432/nodejsscan
9
12
commands =
10
13
py.test -vv --cache-clear tests.py
11
14
You can’t perform that action at this time.
0 commit comments