Skip to content

Use SCOOP_TOKEN for all distribution repos, remove HOMEBREW_TAP_TOKEN #15

Use SCOOP_TOKEN for all distribution repos, remove HOMEBREW_TAP_TOKEN

Use SCOOP_TOKEN for all distribution repos, remove HOMEBREW_TAP_TOKEN #15

Workflow file for this run

name: CI
on:
pull_request:
branches: [main, master]
push:
branches: [main, master]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ['1.21', '1.22', '1.23']
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Run go vet
run: go vet ./...
- name: Run tests with race detector
run: go test -v -race ./...
- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23'
run: go test -v -coverprofile=coverage.out ./...
- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23'
uses: codecov/codecov-action@v4
with:
files: coverage.out
fail_ci_if_error: false
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build binary
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
go build -v -o docmap.exe .
else
go build -v -o docmap .
fi
- name: Test binary runs
shell: bash
run: |
if [ "$RUNNER_OS" = "Windows" ]; then
./docmap.exe README.md
else
./docmap README.md
fi
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Check formatting
run: test -z "$(gofmt -l .)" || (gofmt -d . && exit 1)
- name: Run staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Run go vet
run: go vet ./...
integration:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build binary
run: go build -o docmap .
- name: Test single file mode
run: ./docmap README.md
- name: Test directory mode
run: ./docmap .
- name: Test section filter
run: ./docmap README.md --section "Install" || true
- name: Test nonexistent path handling
run: "! ./docmap /nonexistent/path"