Skip to content

Commit

Permalink
wip: fix task builds
Browse files Browse the repository at this point in the history
  • Loading branch information
abeimler committed Dec 30, 2022
1 parent f0a9521 commit 0968e44
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ jobs:

- name: Build
run: |
task build_emscripten
task emscripten:build
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

- name: Build (Minimal)
run: |
task build_minimal_mingw
task minimal:build:mingw
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
CROSS_CC: ${{ matrix.cross_cc }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ jobs:

- name: Test
run: |
task test
task test_release
task test_install
task main:test
task main:test:release
task install:test
env:
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}

Expand Down
4 changes: 4 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ includes:
taskfile: ./tests/emscripten/Taskfile.yml
dir: ./tests/emscripten

vars:
CWD:
sh: git rev-parse --show-toplevel

tasks:
lint:
- git ls-files --exclude-standard | grep -E '\.(cpp|hpp|c|cc|cxx|hxx|ixx)$' | xargs clang-format -i -style=file
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion tests/emscripten/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_C_STANDARD 99)
# FetchContent_Declare(_project_options URL https://github.com/aminya/project_options/archive/refs/heads/main.zip)
# FetchContent_MakeAvailable(_project_options)
# include(${_project_options_SOURCE_DIR}/Index.cmake)
include(../src/Index.cmake)
include(../../src/Index.cmake)

# opt-in cross-compiling
option(ENABLE_CROSS_COMPILING "Detect cross compiler and setup toolchain" OFF)
Expand Down
4 changes: 2 additions & 2 deletions tests/emscripten/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ version: 3
tasks:
build:
cmds:
- cmake ./test_emscripten -B ./test_emscripten/build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' -DENABLE_CROSS_COMPILING:BOOL=ON -DDEFAULT_TRIPLET=wasm32-emscripten
- cmake --build ./test_emscripten/build --config Debug
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' -DENABLE_CROSS_COMPILING:BOOL=ON -DDEFAULT_TRIPLET=wasm32-emscripten
- cmake --build ./build --config Debug

lint:
- ~/vcpkg/vcpkg format-manifest ./vcpkg.json
2 changes: 1 addition & 1 deletion tests/install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16...3.21)

### Add project_options
include(../src/Index.cmake)
include(../../src/Index.cmake)

run_vcpkg()

Expand Down
9 changes: 3 additions & 6 deletions tests/install/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ includes:

tasks:
build:release:
- cmake ./test -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake --build ./build --config Release

test:release:
Expand All @@ -17,12 +17,9 @@ tasks:
cmds:
- task: test:release
- cmake --install ./build --config Release --prefix ./install
- cmake ./test_install -B ./test_install/build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' -DCMAKE_PREFIX_PATH:STRING={{.CWD}}/install;
- cmake --build ./test_install/build --config Release
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' -DCMAKE_PREFIX_PATH:STRING={{.CWD}}/install;
- cmake --build ./build --config Release
- cd ./build && ctest -C Release --verbose
vars:
CWD:
sh: git rev-parse --show-toplevel

lint:
- ~/vcpkg/vcpkg format-manifest ./vcpkg.json
Expand Down
2 changes: 1 addition & 1 deletion tests/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD 20)
# FetchContent_Declare(_project_options URL https://github.com/aminya/project_options/archive/refs/heads/main.zip)
# FetchContent_MakeAvailable(_project_options)
# include(${_project_options_SOURCE_DIR}/Index.cmake)
include(../src/Index.cmake)
include(../../src/Index.cmake)

# opt-in cross-compiling
option(ENABLE_CROSS_COMPILING "Detect cross compiler and setup toolchain" OFF)
Expand Down
4 changes: 2 additions & 2 deletions tests/main/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ includes:

tasks:
build:
- cmake ./test -B ./build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake --build ./build --config Debug

build:release:
- cmake ./test -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake --build ./build --config Release

test:
Expand Down
2 changes: 1 addition & 1 deletion tests/minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CMAKE_C_STANDARD 99)
# FetchContent_Declare(_project_options URL https://github.com/aminya/project_options/archive/refs/heads/main.zip)
# FetchContent_MakeAvailable(_project_options)
# include(${_project_options_SOURCE_DIR}/Index.cmake)
include(../src/Index.cmake)
include(../../src/Index.cmake)

# opt-in cross-compiling
option(ENABLE_CROSS_COMPILING "Detect cross compiler and setup toolchain" OFF)
Expand Down
4 changes: 2 additions & 2 deletions tests/minimal/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ includes:

tasks:
build:
- cmake ./test_minimal -B ./test_minimal/build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake --build ./test_minimal/build --config Debug
- cmake . -B ./build -DCMAKE_BUILD_TYPE:STRING=Debug -G '{{.CMAKE_GENERATOR | default "Ninja Multi-Config"}}' {{.CMAKE_ARGS}}
- cmake --build ./build --config Debug

build:mingw:
cmds:
Expand Down
5 changes: 5 additions & 0 deletions tests/minimal/Taskfile_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 3

tasks:
clean:
- powershell -c 'function rmrf($path) { if (test-path $path) { rm -r -force $path }}; rmrf ./build'

0 comments on commit 0968e44

Please sign in to comment.