|
| 1 | +name: build-and-test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + schedule: |
| 6 | + - cron: 0 0 * * * |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-and-test: |
| 11 | + if: ${{ github.event_name != 'push' || github.ref_name == github.event.repository.default_branch }} |
| 12 | + runs-on: ubuntu-latest |
| 13 | + container: ${{ matrix.container }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + rosdistro: |
| 18 | + - humble |
| 19 | + include: |
| 20 | + - rosdistro: humble |
| 21 | + container: ros:humble |
| 22 | + build-depends-repos: build_depends.repos |
| 23 | + steps: |
| 24 | + - name: Check out repository |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: Free disk space (Ubuntu) |
| 28 | + uses: jlumbroso/free-disk-space@v1.3.1 |
| 29 | + with: |
| 30 | + tool-cache: false |
| 31 | + dotnet: false |
| 32 | + swap-storage: false |
| 33 | + large-packages: false |
| 34 | + |
| 35 | + - name: Remove exec_depend |
| 36 | + uses: autowarefoundation/autoware-github-actions/remove-exec-depend@v1 |
| 37 | + |
| 38 | + - name: Get self packages |
| 39 | + id: get-self-packages |
| 40 | + uses: autowarefoundation/autoware-github-actions/get-self-packages@v1 |
| 41 | + |
| 42 | + - name: Build |
| 43 | + if: ${{ steps.get-self-packages.outputs.self-packages != '' }} |
| 44 | + uses: autowarefoundation/autoware-github-actions/colcon-build@v1 |
| 45 | + with: |
| 46 | + rosdistro: ${{ matrix.rosdistro }} |
| 47 | + target-packages: ${{ steps.get-self-packages.outputs.self-packages }} |
| 48 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 49 | + |
| 50 | + - name: Test |
| 51 | + if: ${{ steps.get-self-packages.outputs.self-packages != '' }} |
| 52 | + id: test |
| 53 | + uses: autowarefoundation/autoware-github-actions/colcon-test@v1 |
| 54 | + with: |
| 55 | + rosdistro: ${{ matrix.rosdistro }} |
| 56 | + target-packages: ${{ steps.get-self-packages.outputs.self-packages }} |
| 57 | + build-depends-repos: ${{ matrix.build-depends-repos }} |
| 58 | + |
| 59 | + - name: Upload coverage to CodeCov |
| 60 | + if: ${{ steps.test.outputs.coverage-report-files != '' }} |
| 61 | + uses: codecov/codecov-action@v3 |
| 62 | + with: |
| 63 | + files: ${{ steps.test.outputs.coverage-report-files }} |
| 64 | + fail_ci_if_error: false |
| 65 | + verbose: true |
| 66 | + flags: total |
| 67 | + |
| 68 | + - name: Show disk space after the tasks |
| 69 | + run: df -h |
0 commit comments