-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes a separate builder docker image that includes all tools & dependencies.
- Loading branch information
1 parent
1418ec0
commit 7d44237
Showing
5 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: vaas-cpp-toolchain-ci | ||
on: | ||
push: | ||
tags: | ||
- "cpp-toolchain*" | ||
paths: | ||
- "cpp/Dockerfile.build" | ||
- ".github/workflows/ci-cpp-toolchain.yaml" | ||
|
||
jobs: | ||
cpp-toolchain: | ||
name: Build & Push C++ toolchain | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
cpp/Dockerfile.build | ||
sparse-checkout-cone-mode: false | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: set version | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/cpp-toolchain}" >> $GITHUB_ENV | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/gdatasoftwareag/vaas/cpp-toolchain | ||
tags: | | ||
type=semver,pattern={{version}},value=${{ env.RELEASE_VERSION }} | ||
type=semver,pattern={{major}}.{{minor}},value=${{ env.RELEASE_VERSION }} | ||
type=semver,pattern={{major}},value=${{ env.RELEASE_VERSION }} | ||
flavor: | | ||
latest=auto | ||
- name: login to ghcr.io/gdatasoftwareag | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GHCR_IO_GDATASOFTWAREAG_USERNAME }} | ||
password: ${{ secrets.GHCR_IO_GDATASOFTWAREAG_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: "cpp/" | ||
file: "cpp/Dockerfile.build" | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: vaas-cpp-ci | ||
on: | ||
push: | ||
paths: | ||
- "cpp/**" | ||
- ".github/workflows/ci-cpp.yaml" | ||
pull_request: | ||
paths: | ||
- "cpp/**" | ||
- ".github/workflows/ci-cpp.yaml" | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: "Test environment" | ||
options: | ||
- production | ||
- staging | ||
- develop | ||
default: "production" | ||
|
||
env: | ||
CLIENT_ID: ${{ secrets.CLIENT_ID }} | ||
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}} | ||
VAAS_URL: "https://upload.production.vaas.gdatasecurity.de" | ||
TOKEN_URL: "https://account.gdata.de/realms/vaas-production/protocol/openid-connect/token" | ||
VAAS_CLIENT_ID: ${{ secrets.VAAS_CLIENT_ID }} | ||
VAAS_USER_NAME: ${{ secrets.VAAS_USER_NAME }} | ||
VAAS_PASSWORD: ${{secrets.VAAS_PASSWORD}} | ||
jobs: | ||
cpp-build: | ||
name: Build & Test C++ SDK | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/gdatasoftwareag/vaas/cpp-toolchain | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Scan for Viruses | ||
uses: ./.github/actions/vaas-scan-action | ||
with: | ||
VAAS_CLIENT_ID: ${{ secrets.VAAS_SCAN_CLIENT_ID }} | ||
VAAS_CLIENT_SECRET: ${{ secrets.VAAS_SCAN_CLIENT_SECRET }} | ||
|
||
- name: set staging environment | ||
if: (inputs.environment == 'staging' || (startsWith(github.ref, 'refs/tags/cs') && endsWith(github.ref, '-beta'))) | ||
run: | | ||
echo "CLIENT_ID=${{ secrets.STAGING_CLIENT_ID }}" >> $GITHUB_ENV | ||
echo "CLIENT_SECRET=${{ secrets.STAGING_CLIENT_SECRET }}" >> $GITHUB_ENV | ||
echo "VAAS_URL=https://upload.staging.vaas.gdatasecurity.de" >> $GITHUB_ENV | ||
echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-staging/protocol/openid-connect/token" >> $GITHUB_ENV | ||
echo "VAAS_CLIENT_ID=${{ secrets.STAGING_VAAS_CLIENT_ID }}" >> $GITHUB_ENV | ||
echo "VAAS_USER_NAME=${{ secrets.STAGING_VAAS_USER_NAME }}" >> $GITHUB_ENV | ||
echo "VAAS_PASSWORD=${{ secrets.STAGING_VAAS_PASSWORD }}" >> $GITHUB_ENV | ||
- name: set develop environment | ||
if: (inputs.environment == 'develop' || (startsWith(github.ref, 'refs/tags/cs') && endsWith(github.ref, '-alpha'))) | ||
run: | | ||
echo "CLIENT_ID=${{ secrets.DEVELOP_CLIENT_ID }}" >> $GITHUB_ENV | ||
echo "CLIENT_SECRET=${{ secrets.DEVELOP_CLIENT_SECRET }}" >> $GITHUB_ENV | ||
echo "VAAS_URL=https://upload.develop.vaas.gdatasecurity.de" >> $GITHUB_ENV | ||
echo "TOKEN_URL=https://account-staging.gdata.de/realms/vaas-develop/protocol/openid-connect/token" >> $GITHUB_ENV | ||
echo "VAAS_CLIENT_ID=${{ secrets.DEVELOP_VAAS_CLIENT_ID }}" >> $GITHUB_ENV | ||
echo "VAAS_USER_NAME=${{ secrets.DEVELOP_VAAS_USER_NAME }}" >> $GITHUB_ENV | ||
echo "VAAS_PASSWORD=${{ secrets.DEVELOP_VAAS_PASSWORD }}" >> $GITHUB_ENV | ||
- name: Build C++ SDK | ||
run: | | ||
./build.sh | ||
working-directory: cpp | ||
|
||
- name: Test C++ SDK | ||
run: | | ||
./test.sh | ||
working-directory: cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#### Base Image | ||
FROM ubuntu:22.04 | ||
|
||
RUN apt-get update -qq && \ | ||
# install dependencies | ||
apt-get install -y --no-install-recommends git ca-certificates curl zip unzip tar build-essential cmake make pkg-config libssl3 libssl-dev linux-libc-dev && \ | ||
# install vcpkg | ||
cd /usr/local && \ | ||
git clone https://github.com/microsoft/vcpkg.git && \ | ||
cd vcpkg && ./bootstrap-vcpkg.sh | ||
|
||
ENV VCPKG_ROOT="/usr/local/vcpkg/" | ||
ENV PATH="$VCPKG_ROOT:$PATH" | ||
|
||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
set -ex | ||
cmake --preset release | ||
cmake --build build | ||
./build/vaas_test | ||
cmake --build build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
set -ex | ||
./build/vaas_test |