This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
Actions: Update github/codeql-action action to v2.24.0 - autoclosed #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
pull_request: | |
branches: | |
- "*" | |
permissions: | |
contents: read | |
env: | |
DOCKER_REGISTRY: "ghcr.io" | |
DOCKER_REPOSITORY: "wepudt/dynatrace-operator" | |
jobs: | |
# helm-test: | |
# name: Run helm unit tests | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
# - name: Set up Helm | |
# uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Download dependencies | |
# id: helm-unittest-download | |
# run: | | |
# make prerequisites/helm | |
# - name: Run Unit tests | |
# id: helm-unittest | |
# run: | | |
# make test/helm/unit | |
# helm-lint: | |
# name: Run helm linting | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
# - name: Set up Helm | |
# uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Run Linting | |
# id: helm-linting | |
# run: | | |
# make test/helm/lint | |
# tests: | |
# name: Run unit tests | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
# - name: Setup Golang | |
# uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
# with: | |
# go-version-file: "${{ github.workspace }}/go.mod" | |
# - name: Download dependencies | |
# id: depdownload | |
# run: | | |
# hack/build/ci/install-cgo-dependencies.sh | |
# - name: Run Unit tests | |
# id: unittest | |
# run: | | |
# make go/test | |
# linting: | |
# name: Run linting | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
# - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
# with: | |
# go-version-file: "${{ github.workspace }}/go.mod" | |
# - name: Download dependencies | |
# id: depdownload | |
# run: | | |
# hack/build/ci/install-cgo-dependencies.sh | |
# - name: golangci-lint | |
# uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 | |
# with: | |
# version: v1.51.1 | |
# args: --build-tags containers_image_storage_stub,e2e --timeout 300s --out-${NO_FUTURE}format colored-line-number | |
prepare: | |
name: Prepare properties | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Prepare build parameters | |
id: prep | |
run: | | |
hack/build/ci/prepare-build-variables.sh | |
- name: Docker metadata | |
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e # v4.4.0 | |
id: meta | |
with: | |
images: dynatrace/dynatrace-operator | |
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] | |
strategy: | |
matrix: | |
platform: [amd64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Build image | |
if: matrix.platform != 'arm64' || github.ref_protected | |
uses: ./.github/actions/build-image | |
with: | |
platform: ${{ matrix.platform }} | |
labels: ${{ needs.prepare.outputs.labels }} | |
image-tag: ${{ needs.prepare.outputs.version }} | |
push: | |
name: Push images | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: [prepare, build] | |
strategy: | |
matrix: | |
platform: [amd64] | |
if: ${{ !github.event.pull_request.head.repo.fork }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Image | |
if: matrix.platform != 'arm64' || github.ref_protected | |
uses: ./.github/actions/upload-image | |
with: | |
platform: ${{ matrix.platform }} | |
labels: ${{ needs.prepare.outputs.labels }} | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ needs.prepare.outputs.registry }} | |
repository: ${{ needs.prepare.outputs.repository }} | |
manifest: | |
name: Create manifest | |
needs: [prepare, push] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
env: | |
COMBINED: ${{ github.ref_protected }} | |
if: ${{ !github.event.pull_request.head.repo.fork }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Manifests | |
uses: ./.github/actions/create-manifests | |
with: | |
version: ${{ needs.prepare.outputs.version }} | |
registry: ${{ needs.prepare.outputs.registry }} | |
repository: ${{ needs.prepare.outputs.repository }} | |
combined: ${{ env.COMBINED }} |