summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-07-14 18:51:18 -0500
committerChristian Cleberg <[email protected]>2026-07-14 18:51:18 -0500
commiteea656e612d1a31b461fe73f2e26dfe526acfb83 (patch)
treecbe4ae543688c562726b6856bb0beead620f14b3
parent8091c16ef48f5a740c637e8c9bb42b096a3aa958 (diff)
downloaddevianter-eea656e612d1a31b461fe73f2e26dfe526acfb83.tar.gz
devianter-eea656e612d1a31b461fe73f2e26dfe526acfb83.tar.bz2
devianter-eea656e612d1a31b461fe73f2e26dfe526acfb83.zip
feat: add support for building, testing, and publishing releases
-rw-r--r--.github/workflows/ci.yml80
-rw-r--r--.github/workflows/release.yml21
2 files changed, 101 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..3f9de9c
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,80 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ test:
+ name: Test
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ go-version: ['1.18', '1.21']
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version: ${{ matrix.go-version }}
+
+ - name: Cache Go modules
+ uses: actions/cache@v6
+ with:
+ path: ~/go/pkg/mod
+ key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
+ restore-keys: |
+ ${{ runner.os }}-go-${{ matrix.go-version }}-
+
+ - name: Download dependencies
+ run: go mod download
+
+ - name: Run tests
+ run: go test -v -race -coverprofile=coverage.out ./...
+
+ - name: Upload coverage
+ uses: codecov/codecov-action@v3
+ with:
+ files: ./coverage.out
+ flags: unittests
+ name: codecov-umbrella
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version: '1.21'
+
+ - name: golangci-lint
+ uses: golangci/golangci-lint-action@v9
+ with:
+ version: latest
+ args: --timeout=5m
+
+ build:
+ name: Build
+ runs-on: ubuntu-latest
+ needs: [test, lint]
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version: '1.21'
+
+ - name: Build
+ run: go build -v ./...
+
+ - name: Verify module
+ run: go mod verify
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..b14f7ed
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,21 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ - name: Create Release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ draft: false
+ prerelease: false