From 1471849da2d1103e5784bb5b04852f50fca290bb Mon Sep 17 00:00:00 2001 From: Thiago Avelino da Silva Date: Thu, 21 Aug 2025 14:39:20 -0700 Subject: [PATCH] Add Build golang workflow. This workflow will validate if it is possible to run unit tests against the generated GsrSerDe Go version --- .github/workflows/build-golang.yml | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/build-golang.yml diff --git a/.github/workflows/build-golang.yml b/.github/workflows/build-golang.yml new file mode 100644 index 00000000..bed47f54 --- /dev/null +++ b/.github/workflows/build-golang.yml @@ -0,0 +1,83 @@ +name: Build Golang + +on: + push: + branches: [ master, native-schema-registry-2025, native-schema-registry-csharp, native-schema-registry-golang ] + pull_request: + branches: [ master, native-schema-registry-2025, native-schema-registry-csharp, native-schema-registry-golang ] + release: + branches: [ master, native-schema-registry-2025, native-schema-registry-csharp, native-schema-registry-golang ] + types: [ created ] + +jobs: + build-golang: + permissions: + id-token: write + contents: read + continue-on-error: false + timeout-minutes: 60 + runs-on: ubuntu-latest + container: + image: amazonlinux:2023 + steps: + - name: Install required utilities + run: | + yum install -y zip unzip tar findutils gzip clang-tools-extra nodejs wget + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install CMake and dependencies + run: | + yum install -y cmake gcc gcc-c++ git lcov pcre2-devel + yum groupinstall -y "Development Tools" + wget https://sourceforge.net/projects/swig/files/swig/swig-4.3.0/swig-4.3.0.tar.gz + tar -xzf swig-4.3.0.tar.gz + cd swig-4.3.0 + ./configure --prefix=/usr/local + make -j$(nproc) + make install + swig -version + + - name: Set up Java + uses: graalvm/setup-graalvm@v1 + with: + distribution: 'graalvm' + java-version: '17.0.12' + components: 'native-image' + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install Maven 3.9.11 + run: | + curl -sSL https://downloads.apache.org/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz | tar xz + mv apache-maven-3.9.11 /opt/maven + echo "MAVEN_HOME=/opt/maven" >> $GITHUB_ENV + echo "/opt/maven/bin" >> $GITHUB_PATH + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Build Java + shell: bash + run: | + mvn -U clean install -Dcheckstyle.skip=true -DskipTests + + - name: C Make + shell: bash + run: | + cd native-schema-registry/c + cmake -S . -Bbuild + cd build + cmake --build . + + - name: Test Golang + shell: bash + run: | + cd native-schema-registry/golang + yum install -y golang + go mod tidy + make test