## 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)
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-authored-by: marcel.henselin <marcel.henselin@stackit.cloud>
Reviewed-on: #81
91 lines
2.6 KiB
YAML
91 lines
2.6 KiB
YAML
name: Build
|
|
description: "Build pipeline"
|
|
inputs:
|
|
go-version:
|
|
description: "Go version to install"
|
|
default: '1.25'
|
|
required: true
|
|
java-distribution:
|
|
description: "JAVA distribution to use (default: temurin)"
|
|
default: 'temurin'
|
|
java-version:
|
|
description: "JAVA version to use (default: 21)"
|
|
default: '21'
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Install needed tools
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
apt-get -y -qq update
|
|
apt-get -y -qq install jq python3 python3-pip python-is-python3 s3cmd git make wget unzip bc
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Install Go ${{ inputs.go-version }}
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
# go-version: ${{ inputs.go-version }}
|
|
check-latest: true
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Determine GOMODCACHE
|
|
shell: bash
|
|
id: goenv
|
|
run: |
|
|
set -e
|
|
# echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
|
echo "gomodcache=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Restore cached GO pkg
|
|
id: cache-gopkg
|
|
uses: actions/cache/restore@v5
|
|
with:
|
|
path: "${{ steps.goenv.outputs.gomodcache }}"
|
|
key: ${{ runner.os }}-gopkg
|
|
|
|
- name: Install go tools
|
|
if: steps.cache-gopkg.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
go install golang.org/x/tools/cmd/goimports@latest
|
|
go install github.com/hashicorp/terraform-plugin-codegen-framework/cmd/tfplugingen-framework@latest
|
|
go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest
|
|
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest
|
|
|
|
# - name: Run build pkg directory
|
|
# shell: bash
|
|
# run: |
|
|
# set -e
|
|
# go run generator/main.go build
|
|
|
|
- name: Get all go packages
|
|
if: steps.cache-gopkg.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
go get ./...
|
|
|
|
- name: Save Cache
|
|
id: cache-gopkg-save
|
|
uses: actions/cache/save@v5
|
|
with:
|
|
path: |
|
|
${{ steps.goenv.outputs.gomodcache }}
|
|
key: ${{ runner.os }}-gopkg
|
|
|
|
- name: Setup JAVA ${{ inputs.java-distribution }} ${{ inputs.go-version }}
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
distribution: ${{ inputs.java-distribution }} # See 'Supported distributions' for available options
|
|
java-version: ${{ inputs.java-version }}
|
|
|
|
- name: Run make to build app
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
make build
|