|
| 1 | +name: Test conan packages |
| 2 | + |
| 3 | +on: |
| 4 | + # Run weekdays at 11:15pm UTC, and specify below to only run if there's been new commits |
| 5 | + schedule: |
| 6 | + - cron: "15 11 * * 1-5" |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + prepare: |
| 11 | + if: github.repository_owner == 'viamrobotics' |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout Code |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Get new commit count |
| 18 | + id: new_commit_count |
| 19 | + shell: bash |
| 20 | + run: echo "commit_count=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT |
| 21 | + |
| 22 | + - name: Cancelling scheduled build with no new commits |
| 23 | + |
| 24 | + if: | |
| 25 | + steps.new_commit_count.outputs.commit_count == '0' && |
| 26 | + github.event_name == 'schedule' |
| 27 | +
|
| 28 | + build_macos: |
| 29 | + if: github.repository_owner == 'viamrobotics' |
| 30 | + needs: [prepare] |
| 31 | + runs-on: macos-latest |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - target: aarch64-apple-darwin |
| 37 | + platform: macosx_arm64 |
| 38 | + - target: x86_64-apple-darwin |
| 39 | + platform: macosx_x86_64 |
| 40 | + steps: |
| 41 | + - name: Checkout Code |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Install dependencies |
| 45 | + run: | |
| 46 | + brew install cmake |
| 47 | + brew install python ninja buf |
| 48 | + python -m pip install conan |
| 49 | +
|
| 50 | + - name: Build |
| 51 | + run: | |
| 52 | + # `buf` tries to read a CLI config file that we don't actually use located at |
| 53 | + # ~/.config/buf/config.yaml. We don't always have permission to access this |
| 54 | + # directory in CI, so we set the `BUF_CONFIG_DIR` to some other value that we |
| 55 | + # do have permissions for. See https://github.com/bufbuild/buf/issues/2698 for |
| 56 | + # more details. |
| 57 | + export BUF_CONFIG_DIR=$(mktemp -d) |
| 58 | + conan profile detect |
| 59 | + conan create . --build=missing |
| 60 | +
|
| 61 | + build_linux_ubuntu_jammy: |
| 62 | + if: github.repository_owner == 'viamrobotics' |
| 63 | + needs: [prepare] |
| 64 | + runs-on: ${{ matrix.runs_on }} |
| 65 | + container: |
| 66 | + image: ${{ matrix.image }} |
| 67 | + strategy: |
| 68 | + fail-fast: false |
| 69 | + matrix: |
| 70 | + include: |
| 71 | + - target: aarch64-ubuntu-jammy-gnu |
| 72 | + platform: linux_aarch64-ubuntu-jammy |
| 73 | + image: ubuntu:22.04 |
| 74 | + runs_on: buildjet-8vcpu-ubuntu-2204-arm |
| 75 | + - target: x86_64-ubuntu-jammy-gnu |
| 76 | + platform: linux_x86_64-ubuntu-jammy |
| 77 | + image: ubuntu:22.04 |
| 78 | + runs_on: buildjet-8vcpu-ubuntu-2204 |
| 79 | + |
| 80 | + steps: |
| 81 | + - name: Checkout Code |
| 82 | + uses: actions/checkout@v4 |
| 83 | + |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + apt-get update |
| 87 | + apt-get -y dist-upgrade |
| 88 | + DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ |
| 89 | + build-essential \ |
| 90 | + ca-certificates \ |
| 91 | + curl \ |
| 92 | + doxygen \ |
| 93 | + g++ \ |
| 94 | + gdb \ |
| 95 | + gnupg \ |
| 96 | + gpg \ |
| 97 | + less \ |
| 98 | + ninja-build \ |
| 99 | + python3 \ |
| 100 | + python3-pip \ |
| 101 | + software-properties-common \ |
| 102 | + sudo \ |
| 103 | + wget \ |
| 104 | +
|
| 105 | + sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null |
| 106 | + sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null |
| 107 | +
|
| 108 | + apt-get update |
| 109 | + apt-get -y install cmake |
| 110 | +
|
| 111 | + pip install conan |
| 112 | +
|
| 113 | + - name: Create package |
| 114 | + shell: bash |
| 115 | + run: | |
| 116 | + conan profile detect |
| 117 | + conan create . --build=missing |
| 118 | +
|
| 119 | + build_linux_debian: |
| 120 | + if: github.repository_owner == 'viamrobotics' |
| 121 | + needs: [prepare] |
| 122 | + runs-on: ${{ matrix.runs_on }} |
| 123 | + container: |
| 124 | + image: ${{ matrix.image }} |
| 125 | + strategy: |
| 126 | + fail-fast: false |
| 127 | + matrix: |
| 128 | + include: |
| 129 | + - target: aarch64-debian-bullseye |
| 130 | + platform: linux_aarch64-debian-bullseye |
| 131 | + image: debian:bullseye |
| 132 | + runs_on: buildjet-8vcpu-ubuntu-2204-arm |
| 133 | + - target: x86_64-debian-bullseye |
| 134 | + platform: linux_x86_64-debian-bullseye |
| 135 | + image: debian:bullseye |
| 136 | + runs_on: buildjet-8vcpu-ubuntu-2204 |
| 137 | + - target: aarch64-debian-bookworm |
| 138 | + platform: linux_aarch64-debian-bookworm |
| 139 | + image: debian:bookworm |
| 140 | + runs_on: buildjet-8vcpu-ubuntu-2204-arm |
| 141 | + - target: x86_64-debian-bookworm |
| 142 | + platform: linux_x86_64-debian-bookworm |
| 143 | + image: debian:bookworm |
| 144 | + runs_on: buildjet-8vcpu-ubuntu-2204 |
| 145 | + |
| 146 | + steps: |
| 147 | + - name: Checkout Code |
| 148 | + uses: actions/checkout@v4 |
| 149 | + |
| 150 | + - name: Install dependencies |
| 151 | + run: | |
| 152 | + apt-get update |
| 153 | + apt-get -y dist-upgrade |
| 154 | + DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \ |
| 155 | + build-essential \ |
| 156 | + ca-certificates \ |
| 157 | + cmake \ |
| 158 | + curl \ |
| 159 | + g++ \ |
| 160 | + gdb \ |
| 161 | + gnupg \ |
| 162 | + gpg \ |
| 163 | + less \ |
| 164 | + ninja-build \ |
| 165 | + python3 \ |
| 166 | + python3-pip \ |
| 167 | + software-properties-common \ |
| 168 | + sudo \ |
| 169 | + wget |
| 170 | +
|
| 171 | + pip install conan |
| 172 | +
|
| 173 | + - name: Update CMake for bullseye |
| 174 | + if: ${{ matrix.image == 'debian:bullseye' }} |
| 175 | + run: | |
| 176 | + apt-add-repository -y 'deb http://deb.debian.org/debian bullseye-backports main' |
| 177 | +
|
| 178 | + apt-get update |
| 179 | + apt-get -y install cmake |
| 180 | +
|
| 181 | + apt-get -y --no-install-recommends install -t bullseye-backports cmake |
| 182 | +
|
| 183 | + - name: Create package |
| 184 | + shell: bash |
| 185 | + run: | |
| 186 | + conan profile detect |
| 187 | + conan create . --build=missing |
0 commit comments