Skip to content

Commit

Permalink
Build base image in test
Browse files Browse the repository at this point in the history
  • Loading branch information
pzehner committed Jan 23, 2024
1 parent 4e1a0e4 commit 370f3d9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/base_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ jobs:

- name: Build image
# TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from
run: docker build -t base_${{ matrix.backend }} docker/${{ matrix.backend }}
run: docker build \
-t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \
--cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \
--build-arg BUIDKIT_INLINE_CACHE=1 \
docker/${{ matrix.backend }}

- name: Login in GitHub Containers Repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,40 @@ jobs:
clangFormatVersion: 12

build_base:
uses: ./.github/workflows/base_images.yaml
runs-on: ubuntu-latest

strategy:
matrix:
backend:
# - openmp
- cuda
# - hip

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/[email protected]
with:
tool-cache: true
large-packages: false

- name: Checkout repository
uses: actions/checkout@v3

# TODO check if current build has a different Dockerfile

- name: Build image
# TODO improve with caching https://docs.docker.com/engine/reference/commandline/image_build/#cache-from
run: docker build \
-t ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \
--cache-from ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }} \
--build-arg BUIDKIT_INLINE_CACHE=1 \
docker/${{ matrix.backend }}

- name: Login in GitHub Containers Repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: docker push ghcr.io/cexa-project/kokkos-fft/base_${{ matrix.backend }}

build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 370f3d9

Please sign in to comment.