diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02a3c11dde..f8bbb1bc8d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -48,6 +48,31 @@ jobs: scons -j$(nproc) && \ $UNIT_TEST selfdrive/car" + build_mac: + name: build macos + runs-on: macos-10.15 + timeout-minutes: 35 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Cache dependencies + id: dependency-cache + uses: actions/cache@v2 + with: + path: | + ~/.pyenv + ~/Library/Caches/pip + ~/Library/Caches/pipenv + ~/Library/Caches/Homebrew + key: ${{ hashFiles('tools/mac_setup.sh') }} + - name: Install dependencies + run: ./tools/mac_setup.sh + - name: Build openpilot + run: eval "$(pyenv init -)" && scons -j$(nproc) + - name: Brew cleanup + run: brew cleanup # keeps our cache small + docker_push: name: docker push runs-on: ubuntu-16.04 diff --git a/tools/README.md b/tools/README.md index 22de4a9b7c..9e0965ff6a 100644 --- a/tools/README.md +++ b/tools/README.md @@ -24,23 +24,15 @@ Table of Contents Requirements ============ -openpilot tools and the following setup steps are developed and tested on Ubuntu 16.04, MacOS 10.14.2 and Python 3.7.3. +openpilot tools and the following setup steps are developed and tested on Ubuntu 16.04, MacOS 10.14.2 and Python 3.8.2. Setup ============ -1. Run ubuntu_setup.sh, make sure everything completed correctly +1. Run `ubuntu_setup.sh` or `mac_setup.sh`, make sure everything completed correctly 2. Compile openpilot by running ```scons``` in the openpilot directory -3. Add some folders to root - ```bash - sudo mkdir /data - sudo mkdir /data/params - sudo chown $USER /data/params - ``` - - -4. Try out some tools! +3. Try out some tools! Tool examples diff --git a/tools/mac_setup.sh b/tools/mac_setup.sh new file mode 100755 index 0000000000..5097000196 --- /dev/null +++ b/tools/mac_setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash -e + +# install brew +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + +brew install capnp \ + czmq \ + coreutils \ + eigen \ + ffmpeg \ + glfw \ + libarchive \ + libtool \ + llvm \ + pyenv \ + zeromq + +# install python +pyenv install -s 3.8.2 +pyenv global 3.8.2 +pyenv rehash +eval "$(pyenv init -)" + +pip install pipenv==2018.11.26 +pipenv install --system --deploy +