|
| 1 | +name: devel-1.x |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - '1.x' |
| 6 | + paths: |
| 7 | + - Dockerfile |
| 8 | + - cargo/config.toml |
| 9 | + - .github/workflows/devel.yaml |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - 1.x |
| 13 | + paths: |
| 14 | + - Dockerfile |
| 15 | + - cargo/config.toml |
| 16 | + - .github/workflows/devel.yaml |
| 17 | + |
| 18 | +env: |
| 19 | + DOCKER_IMAGE: ghcr.io/${{ github.repository }} |
| 20 | + |
| 21 | +jobs: |
| 22 | + docker-amd64: |
| 23 | + name: Docker devel (amd64) |
| 24 | + runs-on: ubuntu-22.04 |
| 25 | + steps: |
| 26 | + - |
| 27 | + name: Checkout |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 1 |
| 31 | + # https://github.com/actions/runner-images/issues/2840 |
| 32 | + - name: Free disk space |
| 33 | + run: | |
| 34 | + sudo rm -rf /usr/share/dotnet |
| 35 | + sudo rm -rf /usr/local/lib/android/sdk/build-tools |
| 36 | + sudo rm -rf /usr/local/lib/android/sdk/cmake |
| 37 | + sudo rm -rf /usr/local/lib/android/sdk/cmdline-tools |
| 38 | + sudo rm -rf /usr/local/lib/android/sdk/extras |
| 39 | + sudo rm -rf /usr/local/lib/android/sdk/ndk |
| 40 | + - |
| 41 | + name: Login to ghcr.io |
| 42 | + uses: docker/login-action@v3 |
| 43 | + with: |
| 44 | + registry: ghcr.io |
| 45 | + username: ${{ github.actor }} |
| 46 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + - |
| 48 | + name: QEMU |
| 49 | + uses: docker/setup-qemu-action@v3 |
| 50 | + - |
| 51 | + name: Metadata (base) |
| 52 | + id: meta |
| 53 | + uses: docker/metadata-action@v5 |
| 54 | + with: |
| 55 | + images: ${{ env.DOCKER_IMAGE }} |
| 56 | + flavor: | |
| 57 | + latest=false |
| 58 | + tags: | |
| 59 | + type=raw,value=devel-1x-amd64 |
| 60 | + - |
| 61 | + name: Setup (base) |
| 62 | + uses: docker/setup-buildx-action@v3 |
| 63 | + with: |
| 64 | + driver-opts: network=host |
| 65 | + - |
| 66 | + name: Build (base) |
| 67 | + uses: docker/build-push-action@v6 |
| 68 | + with: |
| 69 | + context: . |
| 70 | + platforms: linux/amd64 |
| 71 | + file: Dockerfile |
| 72 | + tags: ${{ steps.meta.outputs.tags }} |
| 73 | + labels: ${{ steps.meta.outputs.labels }} |
| 74 | + build-args: | |
| 75 | + VERSION=0.0.0 |
| 76 | + push: false |
| 77 | + load: true |
| 78 | + cache-from: type=gha,scope=devel-1x-amd64 |
| 79 | + cache-to: type=gha,scope=devel-1x-amd64,mode=max |
| 80 | + - |
| 81 | + name: Inspect (base) |
| 82 | + run: | |
| 83 | + docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} |
| 84 | + - |
| 85 | + name: Tests (base) |
| 86 | + uses: addnab/docker-run-action@v3 |
| 87 | + with: |
| 88 | + image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}" |
| 89 | + shell: bash |
| 90 | + options: -v ${{ github.workspace }}:/root/src |
| 91 | + run: | |
| 92 | + set -eux |
| 93 | + cat /etc/debian_version |
| 94 | + uname -a |
| 95 | + make test-ci |
| 96 | + - |
| 97 | + name: Push (base) |
| 98 | + uses: docker/build-push-action@v6 |
| 99 | + with: |
| 100 | + context: . |
| 101 | + platforms: linux/amd64 |
| 102 | + file: Dockerfile |
| 103 | + tags: ${{ steps.meta.outputs.tags }} |
| 104 | + labels: ${{ steps.meta.outputs.labels }} |
| 105 | + build-args: | |
| 106 | + VERSION=0.0.0 |
| 107 | + push: true |
| 108 | + cache-from: type=gha,scope=devel-1x-amd64 |
| 109 | + cache-to: type=gha,scope=devel-1x-amd64,mode=max |
| 110 | + - |
| 111 | + name: Manifest (base) |
| 112 | + run: | |
| 113 | + docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} |
| 114 | +
|
| 115 | + docker-arm64: |
| 116 | + name: Docker devel (arm64) |
| 117 | + runs-on: ubuntu-22.04-arm |
| 118 | + steps: |
| 119 | + - |
| 120 | + name: Checkout |
| 121 | + uses: actions/checkout@v4 |
| 122 | + with: |
| 123 | + fetch-depth: 1 |
| 124 | + # https://github.com/actions/runner-images/issues/2840 |
| 125 | + - name: Free disk space |
| 126 | + run: | |
| 127 | + sudo rm -rf /usr/share/dotnet |
| 128 | + sudo rm -rf /usr/local/lib/android/sdk/build-tools |
| 129 | + sudo rm -rf /usr/local/lib/android/sdk/cmake |
| 130 | + sudo rm -rf /usr/local/lib/android/sdk/cmdline-tools |
| 131 | + sudo rm -rf /usr/local/lib/android/sdk/extras |
| 132 | + sudo rm -rf /usr/local/lib/android/sdk/ndk |
| 133 | + - |
| 134 | + name: Login |
| 135 | + uses: docker/login-action@v3 |
| 136 | + with: |
| 137 | + registry: ghcr.io |
| 138 | + username: ${{ github.actor }} |
| 139 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 140 | + - |
| 141 | + name: QEMU |
| 142 | + uses: docker/setup-qemu-action@v3 |
| 143 | + - |
| 144 | + name: Metadata (base) |
| 145 | + id: meta |
| 146 | + uses: docker/metadata-action@v5 |
| 147 | + with: |
| 148 | + images: ${{ env.DOCKER_IMAGE }} |
| 149 | + flavor: | |
| 150 | + latest=false |
| 151 | + tags: | |
| 152 | + type=raw,value=devel-1x-arm64 |
| 153 | + - |
| 154 | + name: Setup (base) |
| 155 | + uses: docker/setup-buildx-action@v3 |
| 156 | + with: |
| 157 | + driver-opts: network=host |
| 158 | + - |
| 159 | + name: Build (base) |
| 160 | + uses: docker/build-push-action@v6 |
| 161 | + with: |
| 162 | + context: . |
| 163 | + platforms: linux/arm64 |
| 164 | + file: Dockerfile |
| 165 | + tags: ${{ steps.meta.outputs.tags }} |
| 166 | + labels: ${{ steps.meta.outputs.labels }} |
| 167 | + build-args: | |
| 168 | + VERSION=0.0.0 |
| 169 | + push: false |
| 170 | + load: true |
| 171 | + cache-from: type=gha,scope=devel-1x-arm64 |
| 172 | + cache-to: type=gha,scope=devel-1x-arm64,mode=max |
| 173 | + - |
| 174 | + name: Inspect (base) |
| 175 | + run: | |
| 176 | + docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} |
| 177 | + - |
| 178 | + name: Tests (base) |
| 179 | + uses: addnab/docker-run-action@v3 |
| 180 | + with: |
| 181 | + image: "${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }}" |
| 182 | + shell: bash |
| 183 | + options: -v ${{ github.workspace }}:/root/src |
| 184 | + run: | |
| 185 | + set -eux |
| 186 | + cat /etc/debian_version |
| 187 | + uname -a |
| 188 | + make test-ci |
| 189 | + - |
| 190 | + name: Push (base) |
| 191 | + uses: docker/build-push-action@v6 |
| 192 | + with: |
| 193 | + context: . |
| 194 | + platforms: linux/arm64 |
| 195 | + file: Dockerfile |
| 196 | + tags: ${{ steps.meta.outputs.tags }} |
| 197 | + labels: ${{ steps.meta.outputs.labels }} |
| 198 | + build-args: | |
| 199 | + VERSION=0.0.0 |
| 200 | + push: true |
| 201 | + cache-from: type=gha,scope=devel-1x-arm64 |
| 202 | + cache-to: type=gha,scope=devel-1x-arm64,mode=max |
| 203 | + - |
| 204 | + name: Manifest (base) |
| 205 | + run: | |
| 206 | + docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.version }} |
0 commit comments