chore: add_protocol (#47)

## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Reviewed-on: #47
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
This commit is contained in:
Marcel_Henselin 2026-02-11 09:07:38 +00:00 committed by Marcel_Henselin
parent 399e8ccb0c
commit f2bffa9ece
Signed by: tf-provider.git.onstackit.cloud
GPG key ID: 6D7E8A1ED8955A9C
4 changed files with 391 additions and 710 deletions

View file

@ -1,30 +1,39 @@
# SPDX-License-Identifier: MIT name: 'Setup Go and cache dependencies'
name: 'Forgejo Actions to setup Go and cache dependencies' author: 'Forgejo authors, Marcel S. Henselin'
author: 'Forgejo authors'
description: | description: |
Wrap the setup-go with improved dependency caching. Wrap the setup-go with improved dependency caching.
inputs: inputs:
username: username:
description: 'User for which to manage the dependency cache' description: 'User for which to manage the dependency cache'
default: root default: root
go-version:
description: "go version to install"
default: '1.25'
required: true
runs: runs:
using: "composite" using: "composite"
steps: steps:
- name: "Install zstd for faster caching" - name: "Install zstd for faster caching"
shell: bash
run: | run: |
apt-get update -qq apt-get update -qq
apt-get -q install -qq -y zstd apt-get -q install -qq -y zstd
- name: "Set up Go using setup-go" - name: "Set up Go using setup-go"
uses: https://data.forgejo.org/actions/setup-go@v6 uses: https://code.forgejo.org/actions/setup-go@v6
id: go-version id: go-version
with: with:
go-version-file: "go.mod" go-version: ${{ inputs.go-version }}
check-latest: true # Always check for the latest patch release
# go-version-file: "go.mod"
# do not cache dependencies, we do this manually # do not cache dependencies, we do this manually
cache: false cache: false
- name: "Get go environment information" - name: "Get go environment information"
shell: bash
id: go-environment id: go-environment
run: | run: |
chmod 755 $HOME # ensure ${RUN_AS_USER} has permission when go is located in $HOME chmod 755 $HOME # ensure ${RUN_AS_USER} has permission when go is located in $HOME
@ -36,6 +45,7 @@ runs:
GO_VERSION: ${{ steps.go-version.outputs.go-version }} GO_VERSION: ${{ steps.go-version.outputs.go-version }}
- name: "Create cache folders with correct permissions (for non-root users)" - name: "Create cache folders with correct permissions (for non-root users)"
shell: bash
if: inputs.username != 'root' if: inputs.username != 'root'
# when the cache is restored, only the permissions of the last part are restored # when the cache is restored, only the permissions of the last part are restored
# so assuming that /home/user exists and we are restoring /home/user/go/pkg/mod, # so assuming that /home/user exists and we are restoring /home/user/go/pkg/mod,

View file

@ -146,6 +146,17 @@ jobs:
- name: Test - name: Test
run: make test run: make test
- name: Check coverage threshold
shell: bash
run: |
make coverage
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Coverage: $COVERAGE%"
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
echo "Coverage is below 80%"
# exit 1
fi
- name: Archive code coverage results - name: Archive code coverage results
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:

View file

@ -143,7 +143,7 @@ func (p *Provider) createVersionsFile() error {
// Build the versions file... // Build the versions file...
version := Version{ version := Version{
Version: p.Version, Version: p.Version,
Protocols: []string{"5.1"}, Protocols: []string{"5.1", "6.0"},
Platforms: nil, Platforms: nil,
} }
for _, sum := range shasums { for _, sum := range shasums {