Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use caching CI builds #762

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#

name: FPC test
on:
on:
workflow_dispatch:
osamamagdy marked this conversation as resolved.
Show resolved Hide resolved
push:
paths-ignore:
- '**.md'
Expand Down Expand Up @@ -35,7 +36,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- uses: dorny/paths-filter@v3
id: filter
with:
Expand Down Expand Up @@ -64,6 +68,7 @@ jobs:
DOCKER_QUIET_BUILD: 1
run: |
DOCKER_BUILD_OPTS="--build-arg UBUNTU_VERSION=${{ matrix.os-version }} --build-arg UBUNTU_NAME=${{ matrix.os-name }}" \
GOMODCACHE_PATH=$(go env GOMODCACHE) \
make -C utils/docker run-dev DOCKER_DEV_OPTIONAL_CMD='env IS_CI_RUNNING=true \
make all'

Expand Down
3 changes: 3 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ DOCKER_CMD := docker
# - DOCKER_BASE_RT_IMAGE_APT_ADD_PKGS (for all infrastructure containers)
# - DOCKER_BASE_DEV_IMAGE_APT_ADD_PKGS (for all images which build fabric/fpc code)
# - DOCKER_DEV_IMAGE_APT_ADD_PKGS (for dev image)
# - You can mount your local go mod cache directory
# to that of the docker image which allows caching of the dependencies and faster builds
# - GOMODCACHE_PATH (the path of your local go packages usually known by `go env GOMODCACHE`)


# SGX related settings
Expand Down
7 changes: 7 additions & 0 deletions utils/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,18 @@ endif
# allows to override with `buildx build`
DOCKER_BUILD_CMD ?= build

# allows to mount host gomodcache into the container
GOMODCACHE_PATH ?=
DOCKER_GOMODCACHE=/project/pkg/mod

# Docker run options
# ------------------
DOCKER_DEV_RUN_OPTS ?=
DOCKER_DEV_RUN_OPTS += --rm
# - mount local gomodcache from the host
ifneq ($(GOMODCACHE_PATH),)
DOCKER_DEV_RUN_OPTS += -v "$(GOMODCACHE_PATH)":"$(DOCKER_GOMODCACHE)"
endif
# - import docker daemon socket (so dev container can run docker)
DOCKER_DEV_RUN_OPTS += -v "$(DOCKER_DAEMON_SOCKET)":"$(DOCKER_SOCKET)"
# - mount local fpc repo into the dev container so development inside container is
Expand Down