Skip to content

feat: Add issue priorities command #11

feat: Add issue priorities command

feat: Add issue priorities command #11

Workflow file for this run

name: Go
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
pull-requests: write
# Cancel old runs when new commit pushed to PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
# Skip job if PR is draft or has WIP in title
if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP'))
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache: true
- name: Set up golangci-lint cache
uses: actions/cache@v5
with:
path: ~/.cache/golangci-lint
key: golangci-${{ hashFiles('.golangci.yml') }}-${{ hashFiles('go.sum') }}
restore-keys: |
golangci-${{ hashFiles('.golangci.yml') }}-
golangci-
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
only-new-issues: ${{ github.event_name == 'pull_request' }}
skip-cache: true # Use our custom cache
problem-matchers: true
test:
name: Test
runs-on: ubuntu-latest
# Skip job if PR is draft or has WIP in title
if: github.event_name != 'pull_request' || (!github.event.pull_request.draft && !contains(github.event.pull_request.title, 'WIP'))
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache: true
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...
- name: Upload coverage artifact
uses: actions/upload-artifact@v6
with:
name: coverage
path: coverage.out
coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
permissions:
contents: read
actions: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download coverage artifact
uses: actions/download-artifact@v7
with:
name: coverage
- name: Post coverage report
uses: fgrosse/go-coverage-report@v1.2.0
with:
coverage-artifact-name: "coverage"
coverage-file-name: "coverage.out"
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
strategy:
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./go.mod
cache: true
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "none")
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}"
BINARY_NAME="atl"
if [ "${{ matrix.goos }}" = "windows" ]; then
BINARY_NAME="atl.exe"
fi
go build -ldflags "${LDFLAGS}" -o "build/${BINARY_NAME}" ./cmd/atl
- name: Upload build artifact
uses: actions/upload-artifact@v6
with:
name: atl-${{ matrix.goos }}-${{ matrix.goarch }}
path: build/