Skip to content

Commit ced4f9b

Browse files
anarthalmzimbres
authored andcommitted
Container service
1 parent 43878d6 commit ced4f9b

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
name: CI
1010

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+
1118
on: [push, pull_request]
1219

1320
jobs:
@@ -121,8 +128,30 @@ jobs:
121128
--cxxstd 17,20 \
122129
--variant debug,release
123130
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+
124152
posix-cmake:
125153
name: "CMake ${{ matrix.toolset }} ${{ matrix.cxxstd }} ${{ matrix.build-type }} ${{ matrix.cxxflags }}"
154+
needs: build-redis-container
126155
defaults:
127156
run:
128157
shell: bash
@@ -198,27 +227,33 @@ jobs:
198227
ldflags: '-lc++'
199228

200229
runs-on: ${{ matrix.os }}
201-
# container: ${{matrix.container}}
230+
container: ${{matrix.container}}
202231
env:
203232
CXXFLAGS: ${{matrix.cxxflags}} -Wall -Wextra
204233
LDFLAGS: ${{matrix.ldflags}}
205234
CMAKE_BUILD_PARALLEL_LEVEL: 4
235+
BOOST_REDIS_TEST_SERVER: redis
236+
237+
services:
238+
redis:
239+
image: ghcr.io/${{ github.repository }}:latest
206240

207241
steps:
208-
- name: Checkout
209-
uses: actions/checkout@v3
210-
211242
- name: Install dependencies
212243
run: |
213244
sudo apt-get update
214245
sudo apt-get -y --no-install-recommends install \
215-
g++ \
246+
git \
216247
libssl-dev \
217248
make \
249+
ca-certificates \
218250
cmake \
219251
protobuf-compiler \
220252
python3 \
221253
${{ matrix.install }}
254+
255+
- name: Checkout
256+
uses: actions/checkout@v4
222257

223258
- name: Set up a Redis server
224259
run: |

0 commit comments

Comments
 (0)