Skip to content

Commit 8f49cf9

Browse files
committed
Add caching support to GitHub Actions workflows for improved build efficiency
1 parent 37dd651 commit 8f49cf9

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.github/workflows/build-and-push.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ on:
1515
jobs:
1616
build-and-push:
1717
runs-on: ubuntu-latest
18+
env:
19+
CACHE_FROM: type=local
20+
CACHE_TO: type=local
1821
steps:
22+
- name: Setup cache
23+
if: ${{ inputs.cache }}
24+
run: |
25+
echo "CACHE_FROM=type=gha" >> $GITHUB_ENV
26+
echo "CACHE_TO=type=gha,mode=max" >> $GITHUB_ENV
1927
- name: Login to Docker
2028
uses: docker/login-action@v3
2129
with:
@@ -30,5 +38,5 @@ jobs:
3038
push: true
3139
tags: ${{ inputs.tags }}
3240
target: ${{ inputs.target }}
33-
cache-from:
34-
cache-to:
41+
cache-from: ${{ env.CACHE_FROM }}
42+
cache-to: ${{ env.CACHE_TO }}

.github/workflows/test-build.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
with:
1818
tags: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }}
1919
target: "ci"
20+
cache: true
2021
test:
2122
runs-on: ubuntu-22.04
2223
needs: [build]
@@ -37,12 +38,12 @@ jobs:
3738
DB_USER: odoo
3839
DB_PASSWORD: odoo
3940
WORKERS: "0"
41+
WITHOUT_DEMO: "False"
4042
DOCKER: "true"
4143
steps:
4244
- name: Create config file
4345
run: |
4446
create_config_file.sh
45-
cat /odoo/odoo.cfg
4647
- name: Wait for PostgreSQL
4748
run: |
4849
wait_for_postgres.sh

0 commit comments

Comments
 (0)