|
| 1 | +name: Build, Test & Compile PX4 Projects |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '**' |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Building ${{ matrix.formula }} |
| 14 | + runs-on: macos-latest |
| 15 | + strategy: |
| 16 | + fail-fast: true |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - formula: px4-dev |
| 20 | + build_target: px4_fmu-v5 |
| 21 | + #- formula: px4-sim-gazebo |
| 22 | + #build_target: px4_sitl_default |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout Homebrew tap |
| 26 | + uses: actions/checkout@v4 |
| 27 | + with: |
| 28 | + repository: px4/homebrew-px4 |
| 29 | + path: homebrew-px4 |
| 30 | + |
| 31 | + - name: Update Homebrew |
| 32 | + run: brew update |
| 33 | + |
| 34 | + - name: Tap PX4/px4 repository |
| 35 | + working-directory: homebrew-px4 |
| 36 | + run: brew tap px4/px4 "${{ github.workspace }}/homebrew-px4" |
| 37 | + |
| 38 | + - name: Checkout PX4 Autopilot |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + repository: PX4/PX4-Autopilot |
| 42 | + path: px4-autopilot |
| 43 | + fetch-depth: 0 |
| 44 | + |
| 45 | + - name: Set up Python |
| 46 | + uses: actions/setup-python@v5 |
| 47 | + with: |
| 48 | + python-version: '3.11' |
| 49 | + |
| 50 | + - name: Setup Python virtual environment |
| 51 | + working-directory: px4-autopilot |
| 52 | + run: | |
| 53 | + python3 -m venv venv |
| 54 | + source venv/bin/activate |
| 55 | + pip install --upgrade pip |
| 56 | + pip install -r Tools/setup/requirements.txt |
| 57 | +
|
| 58 | + - name: Add venv to PATH for subsequent steps |
| 59 | + run: echo "${{ github.workspace }}/px4-autopilot/venv/bin" >> "$GITHUB_PATH" |
| 60 | + |
| 61 | + - name: Install formula |
| 62 | + run: brew install --build-from-source ${{ matrix.formula }} |
| 63 | + |
| 64 | + - name: Run formula tests |
| 65 | + run: brew test ${{ matrix.formula }} |
| 66 | + |
| 67 | + - name: Audit formula |
| 68 | + run: brew audit --strict --online ${{ matrix.formula }} |
| 69 | + |
| 70 | + - name: Build PX4 Autopilot |
| 71 | + working-directory: px4-autopilot |
| 72 | + run: | |
| 73 | + source venv/bin/activate |
| 74 | + make ${{ matrix.build_target }} |
0 commit comments