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

Fix: Docker task (Taskfiles) #187

Merged
merged 2 commits into from
Jan 9, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
key: ${{ runner.os }}-mingw-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}-${{ matrix.cmake }}
key: ${{ runner.os }}-mingw-${{ matrix.platform }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}-${{ matrix.cmake }}
restore-keys: |
${{ runner.os }}-${{ env.BUILD_TYPE }}-

Expand All @@ -61,7 +61,7 @@ jobs:
- name: Setup MinGW
uses: egor-tensin/setup-mingw@v2
with:
platform: ${{ matrix.cmake }}
platform: ${{ matrix.platform }}

- name: Build (Minimal)
run: |
Expand Down
10 changes: 9 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,12 @@ services:
build:
context: .
dockerfile: ./docker/Dockerfile.mingw
target: build-minimal-from-triplet
target: build-minimal-from-triplet
minimal-build-mingw-x86:
build:
context: .
dockerfile: ./docker/Dockerfile.mingw
target: build-minimal
environment:
- CROSS_CC=i686-w64-mingw32-gcc
- CROSS_CXX=i686-w64-mingw32-g++
10 changes: 5 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04 AS base

ARG setup_cpp_linux_version="0.24.0"
ARG setup_cpp_linux_version="0.24.1"

# add setup_cpp
# add setup_cpp https://github.com/aminya/setup-cpp
ADD https://github.com/aminya/setup-cpp/releases/download/v${setup_cpp_linux_version}/setup_cpp_linux /setup_cpp_linux
RUN chmod +x /setup_cpp_linux

Expand All @@ -11,7 +11,7 @@ FROM base AS setup

ARG compiler="gcc"
# install cmake, ninja, and ccache
RUN /setup_cpp_linux --compiler $compiler --llvm true --cmake true --ninja true --ccache true --cppcheck true --vcpkg true --conan true --task true
RUN /setup_cpp_linux --compiler $compiler --llvm true --cmake true --doxygen true --ninja true --ccache true --cppcheck true --vcpkg true --conan true --task true


COPY ./docker/entrypoint.sh /docker-entrypoint.sh
Expand All @@ -21,11 +21,11 @@ ENTRYPOINT [ "/docker-entrypoint.sh" ]
FROM setup AS build
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task minimal:build"]
CMD ["/bin/bash", "-c", "task myproj:build"]


FROM setup AS test
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task main:test"]
CMD ["/bin/bash", "-c", "task myproj:test"]

4 changes: 2 additions & 2 deletions docker/Dockerfile.emscripten
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04 AS base

ARG setup_cpp_linux_version="0.24.0"
ARG setup_cpp_linux_version="0.24.1"

# add setup_cpp
# add setup_cpp https://github.com/aminya/setup-cpp
ADD https://github.com/aminya/setup-cpp/releases/download/v${setup_cpp_linux_version}/setup_cpp_linux /setup_cpp_linux
RUN chmod +x /setup_cpp_linux

Expand Down
12 changes: 6 additions & 6 deletions docker/Dockerfile.mingw
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:22.04 AS base

ARG setup_cpp_linux_version="0.24.0"
ARG setup_cpp_linux_version="0.24.1"

# add setup_cpp
# add setup_cpp https://github.com/aminya/setup-cpp
ADD https://github.com/aminya/setup-cpp/releases/download/v${setup_cpp_linux_version}/setup_cpp_linux /setup_cpp_linux
RUN chmod +x /setup_cpp_linux

Expand All @@ -26,22 +26,22 @@ ENTRYPOINT [ "/docker-entrypoint.sh" ]
FROM setup AS build
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task main:build:mingw"]
CMD ["/bin/bash", "-c", "task myproj:build.mingw"]


FROM setup AS build-minimal
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task minimal:build:mingw"]
CMD ["/bin/bash", "-c", "task minimal:build.mingw"]


FROM setup AS build-minimal-from-env
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task minimal:build:mingw:from-env"]
CMD ["/bin/bash", "-c", "task minimal:build.mingw.from-env"]


FROM setup AS build-minimal-from-triplet
COPY . /home/project_options
WORKDIR /home/project_options
CMD ["/bin/bash", "-c", "task minimal:build:mingw:from-triplet"]
CMD ["/bin/bash", "-c", "task minimal:build.mingw.from-triplet"]
11 changes: 5 additions & 6 deletions docker/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ tasks:
gcc:
- docker-compose up --build build-gcc
- docker-compose up --build test-gcc
- docker-compose down build-gcc test-gcc
- docker-compose down

llvm:
- docker-compose up --build build-llvm
- docker-compose up --build test-llvm
- docker-compose down build-llvm test-llvm
- docker-compose down

mingw:
- docker-compose up --build minimal-build-mingw-x64
- docker-compose up --build minimal-build-mingw-x64-from-env
- docker-compose up --build minimal-build-mingw-x64-from-triplet
- docker-compose up --build build-mingw-x64
- docker-compose up --build build-mingw-x86
- docker-compose down minimal-build-mingw-x64 minimal-build-mingw-x64-from-triplet minimal-build-mingw-x64-from-env build-mingw-x64 build-mingw-x86
- docker-compose up --build minimal-build-mingw-x86
- docker-compose down

emscripten:
- docker-compose up --build build-emscripten
- docker-compose down build-emscripten
- docker-compose down