Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/build-golang.yml
Original file line number Diff line number Diff line change
@@ -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 ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would fail for master today, but by the time this change is merged into master, it should succeed. Is that correct?

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Soon, we will need to build and test on musl and glibc separately.

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') }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how the key is constructed here is? Are you caching only pom files?

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
Loading