Skip to content

feat: TextureView type token for per-pass render target (v0.14.0) #25

feat: TextureView type token for per-pass render target (v0.14.0)

feat: TextureView type token for per-pass render target (v0.14.0) #25

Workflow file for this run

name: CI
# CI Strategy:
# - Tests run on Linux, macOS, and Windows (cross-platform shared interfaces)
# - Go 1.25+ required (matches go.mod requirement)
# - Pure Go: zero external dependencies (only gputypes)
#
# Branch Strategy (GitHub Flow):
# - main branch: Production-ready code
# - Feature branches: Tested via pull_request trigger
# - Pull requests: Must pass all checks before merge
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# Build verification - Cross-platform
build:
name: Build - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.25']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Download dependencies
run: go mod download
- name: Verify dependencies
run: go mod verify
- name: Build all packages
run: go build ./...
# Unit tests - Cross-platform
test:
name: Test - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.25']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Download dependencies
run: go mod download
- name: Run go vet
if: matrix.os == 'ubuntu-latest'
run: go vet ./...
- name: Run tests with race detector
shell: bash
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-gpucontext
# Linting
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout=5m
# Code formatting check
formatting:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "ERROR: The following files are not formatted:"
gofmt -l .
echo ""
echo "Run 'go fmt ./...' to fix formatting issues."
exit 1
fi
echo "All files are properly formatted"
# Dependency freshness check
# Uses go-mod-outdated (https://github.com/psampaz/go-mod-outdated)
deps:
name: Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: true
- name: Install go-mod-outdated
run: go install github.com/psampaz/go-mod-outdated@latest
- name: Check direct dependencies for updates
run: |
echo "## Direct Dependencies with Updates"
OUTDATED=$(go list -u -m -json all 2>/dev/null | go-mod-outdated -update -direct || true)
if [ -n "$OUTDATED" ]; then
echo "$OUTDATED"
echo "::warning::Some direct dependencies have updates available"
else
echo "All direct dependencies are up to date!"
fi
- name: Check ecosystem dependencies
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "## Ecosystem Dependencies"
WARNINGS=0
check_dep() {
local DEP=$1 REPO=$2
LOCAL=$(grep "$DEP" go.mod 2>/dev/null | grep -v "^module" | awk '{print $2}')
[ -z "$LOCAL" ] && return 0
LATEST=$(gh release view --repo "$REPO" --json tagName -q '.tagName' 2>/dev/null || echo "")
[ -z "$LATEST" ] && { echo "⚠️ $DEP: $LOCAL (cannot verify)"; return 0; }
if [ "$LOCAL" = "$LATEST" ]; then
echo "✅ $DEP: $LOCAL"
else
echo "❌ $DEP: $LOCAL → $LATEST available"
WARNINGS=$((WARNINGS + 1))
fi
}
check_dep "github.com/gogpu/gputypes" "gogpu/gputypes"
[ $WARNINGS -gt 0 ] && echo "::warning::$WARNINGS ecosystem dep(s) outdated"
exit 0