|
| 1 | +name: "ci" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +permissions: {} |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + path-filter: |
| 19 | + name: path-filter |
| 20 | + runs-on: ubuntu-latest |
| 21 | + timeout-minutes: 5 |
| 22 | + permissions: |
| 23 | + pull-requests: read |
| 24 | + outputs: |
| 25 | + code: ${{ steps.filter.outputs.code }} |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 28 | + with: |
| 29 | + persist-credentials: false |
| 30 | + - id: filter |
| 31 | + uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 |
| 32 | + with: |
| 33 | + filters: .github/filters.yaml |
| 34 | + |
| 35 | + smoke: |
| 36 | + name: smoke |
| 37 | + uses: ./.github/workflows/lima.yml |
| 38 | + with: |
| 39 | + runner: cncf-ubuntu-4-16-x86 |
| 40 | + test: smoke |
| 41 | + distro: fedora-current |
| 42 | + timeout: 20 |
| 43 | + |
| 44 | + vendor: |
| 45 | + name: vendor |
| 46 | + uses: ./.github/workflows/lima.yml |
| 47 | + with: |
| 48 | + runner: cncf-ubuntu-4-16-x86 |
| 49 | + test: vendor |
| 50 | + distro: fedora-current |
| 51 | + timeout: 20 |
| 52 | + |
| 53 | + cross: |
| 54 | + name: cross |
| 55 | + runs-on: cncf-ubuntu-8-32-x86 |
| 56 | + timeout-minutes: 30 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 59 | + with: |
| 60 | + persist-credentials: false |
| 61 | + |
| 62 | + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 63 | + with: |
| 64 | + go-version-file: go.mod |
| 65 | + cache: true |
| 66 | + |
| 67 | + - name: Build all cross targets |
| 68 | + run: make -j4 cross CGO_ENABLED=0 |
| 69 | + |
| 70 | + unit: |
| 71 | + needs: [smoke, vendor, path-filter] |
| 72 | + if: needs.path-filter.outputs.code == 'true' || github.event_name != 'pull_request' |
| 73 | + name: unit ${{ matrix.storage }} |
| 74 | + strategy: |
| 75 | + fail-fast: false |
| 76 | + matrix: |
| 77 | + storage: [vfs, overlay] |
| 78 | + uses: ./.github/workflows/lima.yml |
| 79 | + with: |
| 80 | + runner: cncf-ubuntu-4-16-x86 |
| 81 | + test: unit |
| 82 | + storage: ${{ matrix.storage }} |
| 83 | + priv: root |
| 84 | + distro: fedora-current |
| 85 | + timeout: 60 |
| 86 | + |
| 87 | + conformance: |
| 88 | + needs: [smoke, vendor, path-filter] |
| 89 | + if: needs.path-filter.outputs.code == 'true' || github.event_name != 'pull_request' |
| 90 | + name: conformance ${{ matrix.storage }} |
| 91 | + strategy: |
| 92 | + fail-fast: false |
| 93 | + matrix: |
| 94 | + storage: [vfs, overlay] |
| 95 | + uses: ./.github/workflows/lima.yml |
| 96 | + with: |
| 97 | + runner: cncf-ubuntu-8-32-x86 |
| 98 | + test: conformance |
| 99 | + storage: ${{ matrix.storage }} |
| 100 | + priv: root |
| 101 | + distro: debian-sid |
| 102 | + timeout: 40 |
| 103 | + |
| 104 | + integration: |
| 105 | + needs: [smoke, vendor, path-filter] |
| 106 | + if: needs.path-filter.outputs.code == 'true' || github.event_name != 'pull_request' |
| 107 | + name: integration ${{ matrix.storage }} ${{ matrix.priv }} ${{ matrix.distro }} |
| 108 | + strategy: |
| 109 | + fail-fast: false |
| 110 | + matrix: |
| 111 | + distro: [fedora-current, fedora-prior, debian-sid] |
| 112 | + storage: [vfs, overlay] |
| 113 | + priv: [root, rootless] |
| 114 | + exclude: |
| 115 | + - storage: vfs |
| 116 | + priv: rootless |
| 117 | + - distro: debian-sid |
| 118 | + priv: rootless |
| 119 | + # Skip rootless+overlay: upstream Cirrus's PASSTHROUGH_ENV_RE drops |
| 120 | + # STORAGE_DRIVER through SSH re-exec to rootlessuser, so their |
| 121 | + # "Integration rootless ... w/ overlay" task silently tests vfs. |
| 122 | + # When we propagate STORAGE_DRIVER properly, we expose a real |
| 123 | + # rootless+overlay cleanup bug in buildah's storage code |
| 124 | + # ("replacing mount point .../merged: directory not empty"). |
| 125 | + # Skip these cells until that's fixed upstream. |
| 126 | + - storage: overlay |
| 127 | + priv: rootless |
| 128 | + include: |
| 129 | + - storage: overlay |
| 130 | + priv: root |
| 131 | + distro: fedora-rawhide |
| 132 | + uses: ./.github/workflows/lima.yml |
| 133 | + with: |
| 134 | + runner: cncf-ubuntu-8-32-x86 |
| 135 | + test: integration |
| 136 | + storage: ${{ matrix.storage }} |
| 137 | + priv: ${{ matrix.priv }} |
| 138 | + distro: ${{ matrix.distro }} |
| 139 | + timeout: 60 |
| 140 | + |
| 141 | + in_podman: |
| 142 | + needs: [smoke, vendor, path-filter] |
| 143 | + if: needs.path-filter.outputs.code == 'true' || github.event_name != 'pull_request' |
| 144 | + name: in_podman |
| 145 | + uses: ./.github/workflows/lima.yml |
| 146 | + with: |
| 147 | + runner: cncf-ubuntu-8-32-x86 |
| 148 | + test: in_podman |
| 149 | + storage: vfs |
| 150 | + priv: root |
| 151 | + distro: fedora-current |
| 152 | + timeout: 60 |
| 153 | + |
| 154 | + mac: |
| 155 | + needs: [smoke, vendor] |
| 156 | + name: build (darwin) |
| 157 | + runs-on: macos-15 |
| 158 | + timeout-minutes: 30 |
| 159 | + steps: |
| 160 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 161 | + with: |
| 162 | + persist-credentials: false |
| 163 | + |
| 164 | + - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 |
| 165 | + with: |
| 166 | + go-version-file: go.mod |
| 167 | + cache: true |
| 168 | + |
| 169 | + - name: Build darwin/arm64 |
| 170 | + run: make bin/buildah.darwin.arm64 |
| 171 | + |
| 172 | + - name: Build darwin/amd64 |
| 173 | + run: make bin/buildah.darwin.amd64 |
| 174 | + |
| 175 | + - name: Upload artifacts |
| 176 | + if: always() |
| 177 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 178 | + with: |
| 179 | + name: buildah-darwin |
| 180 | + path: bin/buildah.darwin.* |
| 181 | + if-no-files-found: error |
| 182 | + |
| 183 | + success: |
| 184 | + name: "Total Success" |
| 185 | + if: always() |
| 186 | + needs: |
| 187 | + - path-filter |
| 188 | + - smoke |
| 189 | + - vendor |
| 190 | + - cross |
| 191 | + - unit |
| 192 | + - conformance |
| 193 | + - integration |
| 194 | + - in_podman |
| 195 | + - mac |
| 196 | + runs-on: ubuntu-latest |
| 197 | + steps: |
| 198 | + - name: Check all required jobs |
| 199 | + run: | |
| 200 | + if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]] || \ |
| 201 | + [[ "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then |
| 202 | + echo "One or more required jobs failed or were cancelled" |
| 203 | + exit 1 |
| 204 | + fi |
| 205 | + echo "All required jobs passed or were skipped" |
0 commit comments