Skip to content

Commit 3877326

Browse files
committed
try caching
1 parent 154353a commit 3877326

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
ALPINE_VERSION: ${{ matrix.alpine }}
2121
PHP_VERSION: ${{ matrix.php }}
2222
PHP_MINOR_VERSION: ${{ matrix.release }}
23+
ALPINE_VERSION_SLUG: v${{ matrix.alpine }}
24+
PHP_VERSION_SLUG: php-${{ env.PHP_VERSION }}
25+
PA_BUILD_SLUG: alpine-v${{ matrix.alpine }}_php-${{ matrix.php }}
26+
PA_BUILD_PATH: v${{ matrix.alpine }}/php-${{ matrix.php }}
2327

2428
strategy:
2529
matrix:
@@ -63,23 +67,22 @@ jobs:
6367
- name: git-checkout
6468
uses: actions/checkout@v2
6569

70+
# cache packages.
71+
- name: cache
72+
uses: actions/cache@v2
73+
with:
74+
path: repo/${{ env.PA_BUILD_PATH }}/
75+
key: ${{ env.PA_BUILD_SLUG }}
76+
6677
# debug info.
6778
- name: debug-info
6879
run: |
6980
echo -e "Job strategy: "
7081
echo -e "Alpine Linux: v${{ env.ALPINE_VERSION }}"
7182
echo -e "PHP Version: ${{ env.PHP_VERSION }}"
7283
echo -e "PHP Release: ${{ env.PHP_MINOR_VERSION }}"
73-
74-
# download previously built artifacts.
75-
- uses: actions/download-artifact@v2
76-
with:
77-
name: alpine-v${{ env.ALPINE_VERSION }}-php-${{ env.PHP_VERSION }}
78-
path: repo/v${{ env.ALPINE_VERSION }}/php-${{ env.PHP_VERSION }}
79-
80-
# debug files.
81-
- name: Display structure of downloaded files
82-
run: ls -lhart repo/v${{ env.ALPINE_VERSION }}/php-${{ env.PHP_VERSION }}
84+
echo -e "Current repository files:"
85+
ls -lhart repo/${{ env.ALPINE_VERSION_SLUG }}/${{ env.PHP_VERSION_SLUG }}/x86_64
8386
8487
# build packages.
8588
- name: build
@@ -89,15 +92,15 @@ jobs:
8992
echo -e "${{ secrets.PHP_ALPINE_RSA_PUB }}" > .abuild/php-alpine.rsa.pub
9093
docker-compose run sandbox builder.sh --build --extra --main --extensions
9194
95+
# upload artifacts.
96+
- name: upload
97+
uses: actions/upload-artifact@v2
98+
with:
99+
name: ${{ env.PA_BUILD_SLUG }}
100+
path: repo/${{ env.PA_BUILD_PATH }}
101+
92102
# publish to bintray.
93103
- name: bintray
94104
run: |
95105
echo -e "Publishing to Bintray"
96106
./publish-zip.sh
97-
98-
# upload artifacts.
99-
- name: upload
100-
uses: actions/upload-artifact@v2
101-
with:
102-
name: alpine-v${{ env.ALPINE_VERSION }}-php-${{ env.PHP_VERSION }}
103-
path: repo/*${{ env.ALPINE_VERSION }}/php-${{ env.PHP_VERSION }}

0 commit comments

Comments
 (0)