From 1355fe85cad2d3faf9253ccd82bd80aabab58c15 Mon Sep 17 00:00:00 2001 From: basgys Date: Thu, 26 Jun 2025 14:35:26 +0200 Subject: [PATCH] feat: github workflows This introduces two workflows. One that runs unit tests and another one that prepares a release. --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ .github/workflows/test.yaml | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c909ad9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: release + +permissions: + contents: write + id-token: write + +jobs: + release: + name: release + runs-on: ubuntu-latest + outputs: + version: ${{ steps.semantic-release.outputs.version }} + steps: + - name: Semantic release + id: semantic-release + uses: go-semantic-release/action@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..abe1c1d --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,21 @@ +name: Run unit tests + +on: push + +env: + GO_VERSION: 1.14 + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Run tests + run: go test -v -race ./...