From 6f819eff16267b58258e20f06f9f68467c656811 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 9 Sep 2025 20:05:02 +0000 Subject: [PATCH] Added workflow (#4) Reviewed-on: https://git.kundeng.us/phoenix/textsender-auth/pulls/4 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitea/workflows/workflow.yaml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitea/workflows/workflow.yaml diff --git a/.gitea/workflows/workflow.yaml b/.gitea/workflows/workflow.yaml new file mode 100644 index 0000000..6c82b3c --- /dev/null +++ b/.gitea/workflows/workflow.yaml @@ -0,0 +1,46 @@ +name: Go + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-24.04 # You can change this to macos-latest or windows-latest if needed + + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '1.25.1' # You can specify a specific version or 'stable' + + - name: Build + run: | + go build -v -ldflags "\ + -X main.version=${{ github.ref_name }} \ + -X main.commit=${{ github.sha }} \ + -X main.date=$(date +%Y-%m-%dT%H:%M:%S%z)" \ + -o textsender-auth cmd/api/main.go + + - name: Test + run: go test -v ./... + +# - name: Run gofmt (optional) + # Uncomment to check code formatting with gofmt +# run: | +# if [ -n "$(gofmt -l.)" ]; then +# echo "Go code is not formatted. Please run 'gofmt -w.' to fix it." +# exit 1 +# fi + +# - name: Run golint (optional) + # Uncomment to check code style with golint +# run: | +# if [ -n "$(golint./...)" ]; then +# echo "Go code has style issues. Please run 'golint./...' to see them." +# exit 1 +# fi