Skip to content

CI: Build with Github CI #2

CI: Build with Github CI

CI: Build with Github CI #2

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main", "ci_github-build" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
C_MARCH:
description: 'GCC -march option'
required: false
default: 'skylake-avx512'
type: string
C_MTUNE:
description: 'GCC -mtune option'
required: false
default: 'skylake-avx512'
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'main'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Setup C and Go build environment variables
run: |
export CFLAGS="${CFLAGS} -Ofast -flto=auto -march=${{ inputs.C_MARCH }} -mtune=${{ inputs.C_MTUNE }} -fno-caller-saves -pipe -ffunction-sections -fdata-sections" \
CXXFLAGS="${CXXFLAGS} -Ofast -flto=auto -march=${{ inputs.C_MARCH }} -mtune=${{ inputs.C_MTUNE }} -fno-caller-saves -pipe -ffunction-sections -fdata-sections" \
LDFLAGS="${LDFLAGS} -Wl,--gc-sections -fuse-ld=mold" \
CGO_CFLAGS=${CFLAGS} CGO_CXXFLAGS=${CXXFLAGS} CGO_LDFLAGS=${LDFLAGS}
export GO111MODULE=on GOPROXY='https://proxy.golang.org,direct' GOFLAGS='-ldflags=-w -ldflags=-s -trimpath'
- name: Build
run: |
go build -o bin/snowflake-proxy ./proxy
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: snowflake
path: 'bin'
retention-days: 90
compression-level: 9