Skip to content

Commit 76cf77f

Browse files
authored
Bench 146 caching package dependencies (#29)
* cach poetry dependencies * poetry.lock file not ignored as used in github workflow * exclude migrations file from black test
1 parent 9a5709d commit 76cf77f

4 files changed

Lines changed: 818 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 67 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ "main", "develop" ]
88

99
jobs:
10-
test:
10+
unit_test:
1111

1212
runs-on: ubuntu-latest
1313

@@ -31,16 +31,16 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v3
3333

34+
- name: Install poetry
35+
run: pipx install poetry
36+
3437
- name: Set up Python 3.10
35-
uses: actions/setup-python@v3
38+
uses: actions/setup-python@v4
3639
with:
3740
python-version: '3.10'
38-
39-
- name: Install Dependencies
40-
run: |
41-
python -m pip install --upgrade pip
42-
pip install poetry
43-
poetry update
41+
cache: 'poetry'
42+
43+
- run: poetry update
4444

4545
- name: Run Migrations
4646
run: |
@@ -50,11 +50,64 @@ jobs:
5050
- name: Run Unit Tests
5151
run: poetry run python manage.py test
5252

53-
- name: Run Black Test
54-
run: poetry run black . --line-length=79 --check
53+
black_test:
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- uses: actions/checkout@v3
58+
59+
- name: Install poetry
60+
run: pipx install poetry
61+
62+
- name: Set up Python 3.10
63+
uses: actions/setup-python@v4
64+
with:
65+
python-version: '3.10'
66+
cache: 'poetry'
67+
68+
- run: poetry update
69+
70+
- name: Run Black Test
71+
run: poetry run black . --line-length=79 --check
72+
73+
pycodestyle_test:
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- uses: actions/checkout@v3
78+
79+
- name: Install poetry
80+
run: pipx install poetry
81+
82+
- name: Set up Python 3.10
83+
uses: actions/setup-python@v4
84+
with:
85+
python-version: '3.10'
86+
cache: 'poetry'
87+
88+
- run: poetry update
89+
90+
- name: Run Pycodestyle Test
91+
run: poetry run pycodestyle . --ignore=E501
92+
93+
94+
pyright_test:
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- uses: actions/checkout@v3
99+
100+
- name: Install poetry
101+
run: pipx install poetry
102+
103+
- name: Set up Python 3.10
104+
uses: actions/setup-python@v4
105+
with:
106+
python-version: '3.10'
107+
cache: 'poetry'
108+
109+
- run: poetry update
55110

56-
- name: Run Pycodestyle Test
57-
run: poetry run pycodestyle . --ignore=E501
111+
- name: Run Pyright Test
112+
run: poetry run pyright
58113

59-
- name: Run Pyright Test
60-
run: poetry run pyright

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,3 @@ GitHub.sublime-settings
144144
.idea/*
145145
*.sqlite3
146146

147-
148-
# Poetry
149-
poetry.lock

0 commit comments

Comments
 (0)