Skip to content

Generate files for each app container #40

Generate files for each app container

Generate files for each app container #40

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release-*
pull_request:
branches:
- "*"
permissions:
contents: read
env:
DOCKER_REGISTRY: "quay.io"
DOCKER_REPOSITORY: "dynatrace/dynatrace-bootstrapper"
jobs:
tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Golang
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: "${{ github.workspace }}/go.mod"
- name: Run unit tests and integration tests
id: unittest
run: |
make go/test
linting:
name: Run linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version-file: "${{ github.workspace }}/go.mod"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
# renovate depName=github.com/golangci/golangci-lint
version: v1.63.4
args: --timeout 300s --out-${NO_FUTURE}format colored-line-number
- name: Run deadcode
id: deadcode
run: |
make go/deadcode
markdown-lint:
name: Lint markdown files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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.43.0
prepare:
name: Prepare properties
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare build parameters
id: prep
run: |
hack/build/ci/prepare-build-variables.sh
- name: Docker metadata
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
id: meta
with:
images: ${{ env.DOCKER_REPOSITORY }}
tags: ${{ steps.prep.outputs.docker_image_tag }}
labels: |
${{ steps.prep.outputs.docker_image_labels }}
vcs-ref=${{ github.sha }}
- name: Prepare build parameters
id: prepenv
run: |
# Set output parameters.
# Reason: global envs do not work in workflow calls
# More info: https://github.com/actions/runner/issues/480#issuecomment-1021278915
echo "registry=${{ env.DOCKER_REGISTRY }}" >> "$GITHUB_OUTPUT"
echo "repository=${{ env.DOCKER_REPOSITORY }}" >> "$GITHUB_OUTPUT"
outputs:
labels: ${{ steps.meta.outputs.labels }}
version: ${{ steps.prep.outputs.docker_image_tag }}
registry: ${{ steps.prepenv.outputs.registry }}
repository: ${{ steps.prepenv.outputs.repository }}
build:
name: Build images
runs-on: ubuntu-latest
needs: [prepare, tests, linting]
strategy:
matrix:
platform: [amd64, arm64]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Build image
if: matrix.platform == 'amd64' || github.ref_protected
uses: ./.github/actions/build-image
with:
platform: ${{ matrix.platform }}
labels: ${{ needs.prepare.outputs.labels }}
image-tag: ${{ needs.prepare.outputs.version }}