Skip to content

Commit cdae0ba

Browse files
authored
Fix cache issue with the build workflow (#810)
1 parent d857349 commit cdae0ba

File tree

1 file changed

+12
-44
lines changed

1 file changed

+12
-44
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,10 @@ jobs:
5959
allure-python-commons: allure-python-commons/**
6060
allure-python-commons-test: allure-python-commons-test/**
6161
62-
commons:
63-
name: Build commons
64-
runs-on: ubuntu-latest
65-
needs: [pytest-changes, other-changes]
66-
if: ${{ needs.pytest-changes.outputs.changed == 'true' || needs.other-changes.outputs.packages != '[]' }}
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Cache commons
71-
id: commons
72-
uses: actions/cache@v4
73-
with:
74-
path: dist/
75-
key: commons-${{ github.sha }}
76-
77-
- name: Build python commons
78-
if: steps.commons.outputs.cache-hit != 'true'
79-
run: pip install build &&
80-
python -m build allure-python-commons --outdir dist/ &&
81-
python -m build allure-python-commons-test --outdir dist/
82-
8362
lint:
8463
name: Static check
8564
runs-on: ubuntu-latest
86-
needs: [commons, pytest-changes, other-changes]
65+
needs: [pytest-changes, other-changes]
8766
if: ${{ needs.pytest-changes.outputs.changed == 'true' || needs.other-changes.outputs.packages != '[]' }}
8867
steps:
8968
- uses: actions/checkout@v4
@@ -102,7 +81,7 @@ jobs:
10281
test-pytest:
10382
name: Test allure-pytest
10483
runs-on: ubuntu-latest
105-
needs: [commons, pytest-changes]
84+
needs: [pytest-changes]
10685
if: ${{ needs.pytest-changes.outputs.changed == 'true' }}
10786
strategy:
10887
matrix:
@@ -122,16 +101,10 @@ jobs:
122101
with:
123102
python-version: ${{ matrix.python-version }}
124103

125-
- name: Get commons from cache
126-
id: commons
127-
uses: actions/cache@v4
128-
with:
129-
path: dist/
130-
key: commons-${{ github.sha }}
131-
132104
- name: Install packages
133105
run: |
134-
pip install dist/allure-python-commons*.tar.gz \
106+
pip install ./allure-python-commons \
107+
./allure-python-commons-test \
135108
./allure-pytest \
136109
pytest==${{ matrix.pytest-version }} \
137110
-r ./requirements/testing.txt \
@@ -142,9 +115,9 @@ jobs:
142115
run: poe tests
143116

144117
test-others:
145-
name: Test packages other than allure-pytest
118+
name: Test other packages
146119
runs-on: ubuntu-latest
147-
needs: [commons, other-changes]
120+
needs: [other-changes]
148121
if: ${{ needs.other-changes.outputs.packages != '[]' }}
149122
strategy:
150123
matrix:
@@ -163,18 +136,13 @@ jobs:
163136
with:
164137
python-version: ${{ matrix.python-version }}
165138

166-
- name: Get commons from cache
167-
id: commons
168-
uses: actions/cache@v4
169-
with:
170-
path: dist/
171-
key: commons-${{ github.sha }}
172-
173139
- name: Install packages
174-
run: pip install dist/allure-python-commons*.tar.gz &&
175-
pip install ./${{ matrix.package }} &&
176-
pip install -r ./requirements/testing.txt &&
177-
pip install -r ./requirements/testing/${{ matrix.package }}.txt
140+
run: |
141+
pip install ./allure-python-commons \
142+
./allure-python-commons-test \
143+
./${{ matrix.package }} \
144+
-r ./requirements/testing.txt \
145+
-r ./requirements/testing/${{ matrix.package }}.txt
178146
179147
- name: Test ${{ matrix.package }}
180148
working-directory: ${{ matrix.package }}

0 commit comments

Comments
 (0)