mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 00:33:33 +08:00
Github Actions add MacOS build and fix Tools/setup/OSX.sh
- Tools/setup/OSX.sh wasn't installing px4-dev on fresh run
This commit is contained in:
@@ -0,0 +1,61 @@
|
|||||||
|
name: MacOS build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: macos-10.15
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
config: [
|
||||||
|
px4_fmu-v5_default,
|
||||||
|
tests, # includes px4_sitl
|
||||||
|
]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
with:
|
||||||
|
token: ${{secrets.ACCESS_TOKEN}}
|
||||||
|
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/Library/Caches/pip
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
- name: setup
|
||||||
|
run: ./Tools/setup/OSX.sh
|
||||||
|
|
||||||
|
- name: Prepare ccache timestamp
|
||||||
|
id: ccache_cache_timestamp
|
||||||
|
shell: cmake -P {0}
|
||||||
|
run: |
|
||||||
|
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
|
||||||
|
message("::set-output name=timestamp::${current_date}")
|
||||||
|
- name: ccache cache files
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: ~/.ccache
|
||||||
|
key: ${{matrix.config}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}}
|
||||||
|
restore-keys: ${{matrix.config}}-ccache-
|
||||||
|
- name: setup ccache
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ccache
|
||||||
|
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
|
||||||
|
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||||
|
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
||||||
|
echo "max_size = 400M" >> ~/.ccache/ccache.conf
|
||||||
|
ccache -s
|
||||||
|
ccache -z
|
||||||
|
|
||||||
|
- name: make ${{matrix.config}}
|
||||||
|
run: |
|
||||||
|
ccache -z
|
||||||
|
make ${{matrix.config}}
|
||||||
|
ccache -s
|
||||||
+23
-14
@@ -19,28 +19,37 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# install Homebrew
|
# install Homebrew
|
||||||
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
|
|
||||||
# confirm Homebrew installed correctly
|
|
||||||
brew doctor
|
|
||||||
|
|
||||||
# Install px4-dev formula
|
# Install px4-dev formula
|
||||||
echo
|
|
||||||
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
|
||||||
|
|
||||||
if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
if [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
||||||
|
echo "Re-installing PX4 general dependencies (homebrew px4-dev)"
|
||||||
|
|
||||||
|
# confirm Homebrew installed correctly
|
||||||
|
brew doctor
|
||||||
|
|
||||||
brew tap PX4/px4
|
brew tap PX4/px4
|
||||||
brew reinstall px4-dev
|
brew reinstall px4-dev ccache
|
||||||
elif brew ls --versions px4-dev > /dev/null; then
|
|
||||||
brew tap PX4/px4
|
# python dependencies
|
||||||
brew install px4-dev
|
brew install python3
|
||||||
|
sudo -H python3 -m pip install --upgrade pip
|
||||||
|
else
|
||||||
|
if brew ls --versions px4-dev > /dev/null; then
|
||||||
|
echo "px4-dev already installed"
|
||||||
|
else
|
||||||
|
echo "Installing PX4 general dependencies (homebrew px4-dev)"
|
||||||
|
brew tap PX4/px4
|
||||||
|
brew install px4-dev ccache
|
||||||
|
|
||||||
|
# python dependencies
|
||||||
|
brew install python3
|
||||||
|
sudo -H python3 -m pip install --upgrade pip
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Python3 dependencies
|
# Python3 dependencies
|
||||||
echo
|
|
||||||
echo "Installing PX4 Python3 dependencies"
|
echo "Installing PX4 Python3 dependencies"
|
||||||
brew install python3
|
|
||||||
sudo -H python3 -m pip install --upgrade pip
|
|
||||||
sudo -H python3 -m pip install -r ${DIR}/requirements.txt
|
sudo -H python3 -m pip install -r ${DIR}/requirements.txt
|
||||||
|
|
||||||
# Optional, but recommended additional simulation tools:
|
# Optional, but recommended additional simulation tools:
|
||||||
|
|||||||
Reference in New Issue
Block a user