Try to carry over from setup stage

This commit is contained in:
Jack Christensen 2024-08-11 00:05:30 -04:00
parent a098b5b0e3
commit 8c42618b8a
1 changed files with 8 additions and 5 deletions

View File

@ -2,6 +2,7 @@ stages:
- setup - setup
- build - build
# Setup stage to prepare the environment and vcpkg
setup: setup:
stage: setup stage: setup
image: alpine:latest image: alpine:latest
@ -11,25 +12,27 @@ setup:
- echo "Cloning and setting up vcpkg..." - echo "Cloning and setting up vcpkg..."
- git clone https://github.com/microsoft/vcpkg.git - git clone https://github.com/microsoft/vcpkg.git
- cd vcpkg - cd vcpkg
- export VCPKG_FORCE_SYSTEM_BINARIES=1
- ./bootstrap-vcpkg.sh - ./bootstrap-vcpkg.sh
- ./vcpkg install glew:x64-linux glfw3:x64-linux || true # Prevent script exit on failure - ./vcpkg install glew:x64-linux glfw3:x64-linux
artifacts: artifacts:
paths: paths:
- vcpkg/buildtrees/glew/*.log - vcpkg/ # Save the entire vcpkg directory as an artifact
# Build stage to compile the project
build: build:
stage: build stage: build
image: alpine:latest image: alpine:latest
script: script:
- echo "Building the application..." - echo "Building the application..."
- apk add --no-cache cmake make gcc g++ ninja - apk add --no-cache cmake make gcc g++ ninja
- cd vcpkg
- export VCPKG_FORCE_SYSTEM_BINARIES=1
- export PATH=$PATH:/usr/bin - export PATH=$PATH:/usr/bin
- ls -la # List the contents to check if the vcpkg directory is present
- cd vcpkg # Ensure we can access the vcpkg directory
- cd .. - cd ..
- mkdir -p build - mkdir -p build
- cd build - cd build
- cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=$CI_PROJECT_DIR/vcpkg/scripts/buildsystems/vcpkg.cmake - cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=$CI_PROJECT_DIR/vcpkg/scripts/buildsystems/vcpkg.cmake
- ninja - ninja
dependencies: dependencies:
- setup - setup # Ensure this job depends on the setup stage and uses its artifacts