Skip to content

Commit

Permalink
WIP: Add CI for C++ toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanCoding committed Jul 25, 2024
1 parent b0a16cc commit 3cc8ba3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci-cpp-toolchain.yaml
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 }}
7 changes: 4 additions & 3 deletions cpp/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ RUN apt-get update -qq && \
# install vcpkg
cd /usr/local && \
git clone https://github.com/microsoft/vcpkg.git && \
cd vcpkg && ./bootstrap-vcpkg.sh && \
export VCPKG_ROOT=/usr/local && \
export PATH=$VCPKG_ROOT:$PATH
cd vcpkg && ./bootstrap-vcpkg.sh

ENV VCPKG_ROOT="/usr/local/vcpkg/""
ENV PATH="$VCPKG_ROOT:$PATH"


ENTRYPOINT ["/bin/bash"]

0 comments on commit 3cc8ba3

Please sign in to comment.