From 01e232446dcfd24a273b21c71867d6b4021f5796 Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Mon, 23 May 2022 10:46:20 -0700 Subject: [PATCH] Add build.yml for GitHub Actions. PiperOrigin-RevId: 450475783 Change-Id: I2384b64459c327b94ac98aa0bdd8a5258c5cda0f --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..e93b0ea4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: build + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + mujoco: + strategy: + matrix: + include: + - os: ubuntu-20.04 + cmake_build_args: "-G Ninja -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10" + - os: macos-12 + cmake_build_args: "-G Ninja" + - os: windows-2022 + + name: "MuJoCo on ${{ matrix.os }}" + runs-on: ${{ matrix.os }} + env: + CMAKE_BUILD_ARGS: ${{ matrix.cmake_build_args }} + + steps: + - uses: actions/checkout@v2 + - name: Prepare Linux + if: ${{ runner.os == 'Linux' }} + run: | + sudo apt-get install \ + libgl1-mesa-dev \ + libxinerama-dev \ + libxcursor-dev \ + libxrandr-dev \ + libxi-dev \ + ninja-build + - name: Prepare macOS + if: ${{ runner.os == 'macOS' }} + run: brew install ninja + - name: Configure + run: | + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release $CMAKE_BUILD_ARGS .. + - name: Build + working-directory: build + run: cmake --build . --config=Release + - name: Test + working-directory: build + run: ctest -C Release .