chore(layout): Remove handler and simplify code structure #182
Workflow file for this run
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: presubmit | |
on: | |
pull_request: | |
branches: | |
- dev | |
env: | |
GO_VERSION: 1.23.8 | |
ZIG_VERSION: 0.13.0 | |
GOLINT_ARGS: -v --allow-parallel-runners --timeout=10m --disable errcheck | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ⤵️ | |
uses: actions/checkout@v4 | |
- name: Version 🔢 | |
shell: bash | |
id: version | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ]; then | |
echo "GIT_SHA_SHORT="$(echo "${{ github.event.pull_request.head.sha }}" | head -c 8)"" >> "$GITHUB_OUTPUT" | |
exit 0 | |
fi | |
echo "GIT_SHA_SHORT="$(git log --format="%H" -n 1 | head -c 8)"" >> "$GITHUB_OUTPUT" | |
- name: Setup Go 🛠️ | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Setup Zig 🛠️ | |
uses: mlugg/setup-zig@v1.2.1 | |
with: | |
version: ${{ env.ZIG_VERSION }} | |
- name: Test 🧪 | |
run: | | |
go test -race -mod=readonly ./... | |
- name: Lint 🪥 | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.64.8 | |
working-directory: ./cmd/ | |
args: ${{ env.GOLINT_ARGS }} | |
- name: Run GoReleaser 🏗️ | |
id: goreleaser | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: build --clean --snapshot --parallelism=1 | |
workdir: ./ | |
env: | |
BUILD_VERSION: ${{ steps.version.outputs.GIT_SHA_SHORT }} | |
GORELEASER_CURRENT_TAG: "0.0.0" | |
- name: Archive Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: handler-${{ steps.version.outputs.GIT_SHA_SHORT }} | |
path: | | |
./dist |