-
Notifications
You must be signed in to change notification settings - Fork 123
Add Golang Build Workflow #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: native-schema-registry-2025
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 ] | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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') }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment.
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?