diff --git a/.github/workflows/base_images.yaml b/.github/workflows/base_images.yaml index 310ba851..19b57de2 100644 --- a/.github/workflows/base_images.yaml +++ b/.github/workflows/base_images.yaml @@ -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 diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 699306d1..71f59b36 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -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/free-disk-space@v1.2.0 + 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