|
8 | 8 |
|
9 | 9 | name: CI
|
10 | 10 |
|
| 11 | +# Permissions for GITHUB_TOKEN |
| 12 | +permissions: |
| 13 | + # Required for actions/checkout |
| 14 | + contents: read |
| 15 | + # Required to save the Docker container to the GitHub container registry |
| 16 | + packages: write |
| 17 | + |
11 | 18 | on: [push, pull_request]
|
12 | 19 |
|
13 | 20 | jobs:
|
@@ -121,8 +128,30 @@ jobs:
|
121 | 128 | --cxxstd 17,20 \
|
122 | 129 | --variant debug,release
|
123 | 130 |
|
| 131 | + build-redis-container: |
| 132 | + name: Build Redis container |
| 133 | + runs-on: ubuntu-latest |
| 134 | + steps: |
| 135 | + - name: Checkout |
| 136 | + uses: actions/checkout@v4 |
| 137 | + |
| 138 | + - name: Log in to the Container registry |
| 139 | + uses: docker/login-action@v2 |
| 140 | + with: |
| 141 | + registry: ghcr.io |
| 142 | + username: ${{ github.actor }} |
| 143 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 144 | + |
| 145 | + - name: Build and push |
| 146 | + uses: docker/build-push-action@v4 |
| 147 | + with: |
| 148 | + context: tools |
| 149 | + push: true |
| 150 | + tags: ghcr.io/${{ github.repository }}:latest |
| 151 | + |
124 | 152 | posix-cmake:
|
125 | 153 | name: "CMake ${{ matrix.toolset }} ${{ matrix.cxxstd }} ${{ matrix.build-type }} ${{ matrix.cxxflags }}"
|
| 154 | + needs: build-redis-container |
126 | 155 | defaults:
|
127 | 156 | run:
|
128 | 157 | shell: bash
|
@@ -198,27 +227,33 @@ jobs:
|
198 | 227 | ldflags: '-lc++'
|
199 | 228 |
|
200 | 229 | runs-on: ${{ matrix.os }}
|
201 |
| - # container: ${{matrix.container}} |
| 230 | + container: ${{matrix.container}} |
202 | 231 | env:
|
203 | 232 | CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra
|
204 | 233 | LDFLAGS: ${{matrix.ldflags}}
|
205 | 234 | CMAKE_BUILD_PARALLEL_LEVEL: 4
|
| 235 | + BOOST_REDIS_TEST_SERVER: redis |
| 236 | + |
| 237 | + services: |
| 238 | + redis: |
| 239 | + image: ghcr.io/${{ github.repository }}:latest |
206 | 240 |
|
207 | 241 | steps:
|
208 |
| - - name: Checkout |
209 |
| - uses: actions/checkout@v3 |
210 |
| - |
211 | 242 | - name: Install dependencies
|
212 | 243 | run: |
|
213 | 244 | sudo apt-get update
|
214 | 245 | sudo apt-get -y --no-install-recommends install \
|
215 |
| - g++ \ |
| 246 | + git \ |
216 | 247 | libssl-dev \
|
217 | 248 | make \
|
| 249 | + ca-certificates \ |
218 | 250 | cmake \
|
219 | 251 | protobuf-compiler \
|
220 | 252 | python3 \
|
221 | 253 | ${{ matrix.install }}
|
| 254 | + |
| 255 | + - name: Checkout |
| 256 | + uses: actions/checkout@v4 |
222 | 257 |
|
223 | 258 | - name: Set up a Redis server
|
224 | 259 | run: |
|
|
0 commit comments