Skip to content

Update Dev tooling #1066

Update Dev tooling

Update Dev tooling #1066

Workflow file for this run

name: CI
on:
push:
tags:
- "v*"
branches:
- main
pull_request:
branches:
- "*"
merge_group:
types: [checks_requested]
permissions:
contents: read
env:
IMAGE: "dynatrace/dynatrace-bootstrapper"
REGISTRY: "ghcr.io"
jobs:
tests:
name: Run unit tests
runs-on: ubuntu-latest
if: github.ref_type != 'tag'
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Golang
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: "${{ github.workspace }}/go.mod"
cache: false
- name: Run unit tests and integration tests
id: unittest
run: |
make go/test
linting:
name: Run linting
runs-on: ubuntu-latest
if: github.ref_type != 'tag'
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version-file: "${{ github.workspace }}/go.mod"
cache: false
- name: Run lint
run: |
make go/lint
markdown-lint:
name: Lint markdown files
runs-on: ubuntu-latest
if: github.ref_type != 'tag'
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Lint markdown files
uses: articulate/actions-markdownlint@87f495d21507d6844dc917a01e742eaaa45049c0 # v1.1.0
with:
config: .markdownlint.json
# renovate depName=github.com/igorshubovych/markdownlint-cli
version: v0.49.1
prepare:
name: Prepare properties
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Prepare build parameters
id: prep
run: |
hack/build/ci/prepare-build-variables.sh
outputs:
labels: |
${{ steps.prep.outputs.docker_image_labels }}
vcs-ref=${{ github.sha }}
version: ${{ steps.prep.outputs.docker_image_tag }}
go_linker_args: ${{ steps.prep.outputs.go_linker_args }}
build-push:
name: Build and push images
runs-on: ubuntu-latest
needs: [prepare]
permissions:
packages: write
if: github.repository_owner == 'Dynatrace' && github.event_name != 'merge_group'
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Login to container registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Build and push
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
provenance: false
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ needs.prepare.outputs.version }}
labels: ${{ needs.prepare.outputs.labels }}
build-args: |
GO_LINKER_ARGS=${{ needs.prepare.outputs.go_linker_args }}