Skip to content

Commit 99bcb7f

Browse files
devcontainers fix, test and add wolfssl
refactored installer to have a script that could be reused
1 parent 0129f53 commit 99bcb7f

File tree

6 files changed

+62
-11
lines changed

6 files changed

+62
-11
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM ubuntu:22.04
22

33
RUN export DEBIAN_FRONTEND=noninteractive \
44
&& apt-get update && apt-get -y install \
5-
clang++ \
65
clang-format \
76
clang-tidy \
87
cmake \
@@ -14,4 +13,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
1413
libgtest-dev \
1514
&& rm -rf /var/lib/apt/lists/*
1615

16+
ENV CMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1"
17+
ENV CMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1"
18+
ENV CMAKE_C_CLANG_TIDY="clang-tidy;-fix"
1719
ENV CMAKE_CXX_CLANG_TIDY="clang-tidy;-fix"

.devcontainer/wolfssl/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:22.04
2+
3+
RUN export DEBIAN_FRONTEND=noninteractive \
4+
&& apt-get update && apt-get -y install \
5+
autoconf \
6+
build-essential \
7+
clang-format \
8+
clang-tidy \
9+
cmake \
10+
doxygen \
11+
graphviz \
12+
git \
13+
g++ \
14+
libgtest-dev \
15+
libtool \
16+
wget \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# https://www.warp.dev/terminus/dockerfile-run-sh
20+
COPY ./.github/actions/install/wolfssl/install.sh /wolfssl/install.sh
21+
RUN /wolfssl/install.sh
22+
23+
ENV JWT_SSL_LIBRARY="wolfSSL"
24+
ENV CMAKE_C_CLANG_TIDY="clang-tidy;-fix"
25+
ENV CMAKE_CXX_CLANG_TIDY="clang-tidy;-fix"

.devcontainer/wolfssl/devcontainer.json

Whitespace-only changes.

.github/actions/install/wolfssl/action.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ runs:
99
using: composite
1010
steps:
1111
- run: |
12-
cd /tmp
13-
wget -O wolfssl.tar.gz https://github.com/wolfSSL/wolfssl/archive/${{ inputs.version }}.tar.gz
14-
tar -zxf /tmp/wolfssl.tar.gz
15-
cd wolfssl-*
16-
autoreconf -fiv
17-
./configure --enable-opensslall --enable-opensslextra --disable-examples --disable-crypttests --enable-harden --enable-all --enable-all-crypto
18-
make
19-
sudo make install
20-
shell: bash
21-
- run: sudo rm -rf /usr/include/openssl
12+
./.github/actions/install/wolfssl/install.sh
13+
sudo rm -rf /usr/include/openssl
2214
shell: bash
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! /bin/sh
2+
set -e # Exit on error
3+
DEFAULT_VERSION="v5.3.0-stable"
4+
VERSION="${1:-$DEFAULT_VERSION}"
5+
6+
cd /tmp
7+
wget -O wolfssl.tar.gz https://github.com/wolfSSL/wolfssl/archive/$VERSION.tar.gz
8+
tar -zxf wolfssl.tar.gz
9+
cd wolfssl-*
10+
autoreconf -fiv
11+
./configure --prefix=/usr/local --enable-opensslall --enable-opensslextra --disable-examples --disable-crypttests --enable-harden --enable-all --enable-all-crypto
12+
make
13+
14+
# Depending if we run in on a GitHub Actions or from within a Docker image we have different permissions
15+
if [[ $EUID > 0 ]]; then
16+
# If we are not root then we need to sudo
17+
sudo make install
18+
else
19+
# Default docker image does not have users setup so we are only root and can not sudo
20+
make install
21+
fi
22+
23+
cd /tmp
24+
rm wolfssl.tar.gz
25+
rm -rf wolfssl-*

.github/workflows/jwt.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,10 @@ jobs:
9191
cmake --build --preset ci-ubsan --target rsa-verify-run
9292
cmake --build --preset ci-ubsan --target jwks-verify-run
9393
cmake --build --preset ci-ubsan --target jwt-cpp-test-run
94+
95+
devcontainers:
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
- run: docker build -t default -f .devcontainer/Dockerfile
100+
- run: docker build -t wolfssl -f .devcontainer/wolfssl/Dockerfile

0 commit comments

Comments
 (0)