perf+style: fix all performance and style issues from codebase review #170
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - 'os-image/**' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: 'go.mod' | |
| - name: Build | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: '0' | |
| run: | | |
| VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo dev) | |
| REVISION=$(git rev-parse HEAD) | |
| BUILTAT=$(date +%Y-%m-%dT%H:%M:%S) | |
| LDFLAGS="-s -X github.com/cocoonstack/cocoon/version.VERSION=${VERSION} \ | |
| -X github.com/cocoonstack/cocoon/version.REVISION=${REVISION} \ | |
| -X github.com/cocoonstack/cocoon/version.BUILTAT=${BUILTAT}" | |
| go build -ldflags "${LDFLAGS}" -o cocoon-${{ matrix.goos }}-${{ matrix.goarch }} . | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: cocoon-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: cocoon-${{ matrix.goos }}-${{ matrix.goarch }} | |
| retention-days: 30 |