File tree 1 file changed +49
-19
lines changed
1 file changed +49
-19
lines changed Original file line number Diff line number Diff line change @@ -18,22 +18,52 @@ jobs:
18
18
runs-on : ubuntu-latest
19
19
20
20
steps :
21
- - name : Checkout code
22
- uses : actions/checkout@v3
23
-
24
- - name : Set up Python
25
- uses : actions/setup-python@v4
26
- with :
27
- python-version : 3.9
28
-
29
- - name : Install dependencies
30
- run : |
31
- python -m venv venv
32
- source venv/bin/activate
33
- pip install -r requirements.txt
34
-
35
- - name : Run tests
36
- run : |
37
- source venv/bin/activate
38
- pip install -e .
39
- pytest tests/
21
+ - name : Checkout code
22
+ uses : actions/checkout@v3
23
+
24
+ - name : Set up Python
25
+ uses : actions/setup-python@v4
26
+ with :
27
+ python-version : 3.9
28
+
29
+ - name : Install dependencies
30
+ run : |
31
+ python -m venv venv
32
+ source venv/bin/activate
33
+ pip install -r requirements.txt
34
+
35
+ - name : Cache dependencies
36
+ uses : actions/cache@v3
37
+ with :
38
+ path : venv
39
+ key : ${{ runner.os }}-venv-${{ hashFiles('requirements.txt') }}
40
+ restore-keys : |
41
+ ${{ runner.os }}-venv-
42
+ test :
43
+ needs : build # Ensures tests run only after a successful build
44
+ runs-on : ubuntu-latest
45
+
46
+ steps :
47
+ - name : Checkout code
48
+ uses : actions/checkout@v3
49
+
50
+ - name : Set up Python
51
+ uses : actions/setup-python@v4
52
+ with :
53
+ python-version : 3.9
54
+
55
+ - name : Restore cached dependencies
56
+ uses : actions/cache@v3
57
+ with :
58
+ path : venv
59
+ key : ${{ runner.os }}-venv-${{ hashFiles('requirements.txt') }}
60
+
61
+ - name : Activate virtual environment and install dependencies
62
+ run : |
63
+ source venv/bin/activate
64
+ pip install -e .
65
+
66
+ - name : Run tests
67
+ run : |
68
+ source venv/bin/activate
69
+ pytest tests/
You can’t perform that action at this time.
0 commit comments