This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
CI #652
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
schedule: | |
# Run at 02:00 UTC every Saturday | |
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events | |
- cron: "0 2 * * SAT" | |
env: | |
VCPKG_ROOT: C:\dartsim\vcpkg | |
VCPKG_VERSION: "2023.06.20" | |
jobs: | |
setup_and_build_base: | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Install vcpkg | |
shell: cmd | |
run: | | |
git clone -q https://github.com/microsoft/vcpkg.git %VCPKG_ROOT% | |
cd /d %VCPKG_ROOT% | |
git checkout %VCPKG_VERSION% | |
%VCPKG_ROOT%\bootstrap-vcpkg.bat | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: base | |
path: C:\dartsim\vcpkg | |
build_deps_and_upload: | |
needs: setup_and_build_base | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: | |
zip-name: ["vcpkg-dartsim-deps-v7.0"] | |
deps: ["assimp ccd eigen3 entt fcl fmt spdlog bullet3 coin-or-ipopt freeglut glfw3 nlopt ode opencl opengl osg pagmo2 pybind11 tinyxml2 urdfdom yaml-cpp"] | |
include: | |
- zip-name: "vcpkg-dartsim-deps-v6.13" | |
deps: "assimp ccd eigen3 fcl fmt spdlog bullet3 coin-or-ipopt flann freeglut glfw3 nlopt ode opengl osg pagmo2 pybind11 tinyxml2 urdfdom" | |
- zip-name: "vcpkg-dartsim-deps-min-v7.0" | |
deps: "assimp ccd eigen3 entt fcl fmt spdlog" | |
- zip-name: "vcpkg-dartsim-deps-cuda-v7.0" | |
deps: "assimp ccd eigen3 entt fcl fmt spdlog bullet3 coin-or-ipopt cuda freeglut glfw3 nlopt ode opencl opengl osg pagmo2 pybind11 tinyxml2 urdfdom yaml-cpp" | |
# - zip-name: "vcpkg-dartsim-deps-v8.0" | |
# deps: "eigen3 fmt pkgconf assimp bullet3 ccd coin-or-ipopt fcl glew imgui nlopt ode opencl opengl osg pybind11 spdlog tbb tinyxml2 urdfdom" | |
# - zip-name: "vcpkg-dartsim-deps-cuda-v8.0" | |
# deps: "eigen3 fmt pkgconf assimp bullet3 ccd coin-or-ipopt cuda fcl glew imgui nlopt ode opencl opengl osg pybind11 spdlog tbb tinyxml2 urdfdom" | |
steps: | |
- name: Download Base Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: base | |
path: ${{ env.VCPKG_ROOT }} | |
# Install CUDA Toolkit conditionally | |
- uses: Jimver/[email protected] | |
if: contains(matrix.deps, 'cuda') | |
id: cuda-toolkit | |
with: | |
cuda: "12.1.0" | |
# Install DART dependencies | |
- name: Install vcpkg Packages | |
env: | |
VCPKG_PACKAGES: ${{ matrix.deps }} | |
shell: cmd | |
run: | | |
%VCPKG_ROOT%\vcpkg.exe install --recurse --triplet x64-windows %VCPKG_PACKAGES% | |
# Remove temporary files | |
# https://learn.microsoft.com/en-us/vcpkg/about/faq#how-can-i-remove-temporary-files | |
- name: Cleanup vcpkg Temporary Files | |
shell: cmd | |
run: | | |
RMDIR /Q/S %VCPKG_ROOT%\buildtrees | |
RMDIR /Q/S %VCPKG_ROOT%\packages | |
RMDIR /Q/S %VCPKG_ROOT%\downloads | |
- name: Prepare Release File | |
shell: cmd | |
run: | | |
7z a -mx9 ${{ matrix.zip-name }}.zip %VCPKG_ROOT% | |
@echo off | |
setlocal | |
set file="${{ matrix.zip-name }}.zip" | |
set maxbytesize=2000000000 | |
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA | |
if %size% GTR %maxbytesize% ( | |
echo File is greater than %maxbytesize% bytes | |
exit /b 1 | |
) | |
- name: Upload Release Asset | |
if: github.event_name == 'release' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ matrix.zip-name }}.zip | |
asset_name: ${{ matrix.zip-name }}.zip | |
asset_content_type: application/zip |