1
0
Fork 0
mirror of https://github.com/external-secrets/external-secrets.git synced 2024-12-14 11:57:59 +00:00
external-secrets/.github/workflows/ci.yml

173 lines
5 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
- main
feat: LTS release process (#2155) * feat: auto-update dependencies Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * docs: add release docs Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: remove note about image tag Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * fix: add variables to allow build from release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * Update design/006-LTS-release.md Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> * fix: github ref regex match release branch Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> * feat: migrate to new issue template format Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> --------- Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com>
2023-05-15 07:06:15 +00:00
- release-*
pull_request: {}
env:
# Common versions
GOLANGCI_VERSION: 'v1.54.2'
KUBERNETES_VERSION: '1.28.x'
2021-12-17 11:23:57 +00:00
2021-09-28 16:55:16 +00:00
# Sonar
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
permissions:
contents: read
jobs:
detect-noop:
permissions:
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
contents: read # for fkirc/skip-duplicate-actions to read and compare commits
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
lint:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true' && github.ref != 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
2021-06-25 23:56:42 +00:00
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
id: setup-go
2021-06-25 23:56:42 +00:00
with:
go-version-file: "go.mod"
2021-06-25 23:56:42 +00:00
- name: Download Go modules
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Lint
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: ${{ env.GOLANGCI_VERSION }}
skip-pkg-cache: true
skip-build-cache: true
check-diff:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true' && github.ref != 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
id: setup-go
with:
go-version-file: "go.mod"
- name: Download Go modules
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Check Diff
run: |
make check-diff
unit-tests:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Fetch History
run: git fetch --prune --unshallow
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
id: setup-go
with:
go-version-file: "go.mod"
- name: Download Go modules
if: ${{ steps.setup-go.outputs.cache-hit != 'true' }}
run: go mod download
2021-06-25 23:56:42 +00:00
- name: Cache envtest binaries
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: bin/k8s
key: ${{ runner.os }}-envtest-${{env.KUBERNETES_VERSION}}
- name: Run Unit Tests
2021-06-25 23:56:42 +00:00
run: |
make test
- name: Publish Unit Test Coverage
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unittests
file: ./cover.out
publish-artifacts:
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
uses: ./.github/workflows/publish.yml
permissions:
id-token: write
contents: read
strategy:
matrix:
include:
- dockerfile: "Dockerfile"
build-args: "CGO_ENABLED=0"
Add in s390x build (#2613) * release 0.9.3 (#2612) Signed-off-by: Gustavo Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Add in s390x build Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Revert "Add in s390x build" This reverts commit 5b45296c0cf3a89032e5b7bb17949204d4da84e9. Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Add s390x build to distroless tag Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * handle special case for imported cert secret type (#2629) Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Co-authored-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Set builder.OnlyMetadata back for Secrets (#2625) Signed-off-by: shuheiktgw <s-kitagawa@mercari.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * convert the fetched secret to map to access the properties (#2637) Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Co-authored-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * updating refreshTime and adding lastTransitionTime in doc FAQ (#2640) Signed-off-by: rakuge <101624788+rakrueger@users.noreply.github.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * docs: Fix (#2627) remove redundant pipe(`|`) Signed-off-by: nikkie <takuyafjp+develop@gmail.com> Co-authored-by: Moritz Johner <moolen@users.noreply.github.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Update common-k8s-secret-types.md (#2624) Add example for templating dockerconfigjson given: * container registry name * container registry host (e.g. ghcr.io) * container registry password Signed-off-by: Layer8Err <dwight.brenner@gmail.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * chore(deps): bump golang from 1.20.6-alpine to 1.21.0-alpine (#2604) Bumps golang from 1.20.6-alpine to 1.21.0-alpine. --- updated-dependencies: - dependency-name: golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Using Bitwarden notes for multiline secrets (#2635) * Using Bitwarden notes for multiline secrets Signed-off-by: Laszlo Fogas <laszlo@gimlet.io> * Update docs/snippets/bitwarden-secret.yaml Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> --------- Signed-off-by: Laszlo Fogas <laszlo@gimlet.io> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Moritz Johner <moolen@users.noreply.github.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * fix: template funcs need to be wrapped in raw block (#2642) Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Revert "Add s390x build to distroless tag" This reverts commit 92996ebb9a1084f02a6eb772ba4a4b2ad1c3ceab. Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Revert "Merge remote-tracking branch 'upstream/main'" This reverts commit e9401d72b69b2d2c593548ba1c91bc8128cff64d, reversing changes made to 92996ebb9a1084f02a6eb772ba4a4b2ad1c3ceab. Signed-off-by: Joshua Beha <joshua.beha@ibm.com> * Add s390x to distroless tag Signed-off-by: Joshua Beha <joshua.beha@ibm.com> --------- Signed-off-by: Gustavo Carvalho <gusfcarvalho@gmail.com> Signed-off-by: Joshua Beha <joshua.beha@ibm.com> Signed-off-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Signed-off-by: shuheiktgw <s-kitagawa@mercari.com> Signed-off-by: rakuge <101624788+rakrueger@users.noreply.github.com> Signed-off-by: nikkie <takuyafjp+develop@gmail.com> Signed-off-by: Layer8Err <dwight.brenner@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Laszlo Fogas <laszlo@gimlet.io> Signed-off-by: Moritz Johner <moolen@users.noreply.github.com> Signed-off-by: Moritz Johner <beller.moritz@googlemail.com> Co-authored-by: Gustavo Fernandes de Carvalho <gusfcarvalho@gmail.com> Co-authored-by: Shanti G <81566195+Shanti-G@users.noreply.github.com> Co-authored-by: shanti.gundumalla@ibm.com <shanti.gundumalla@ibm.com> Co-authored-by: Shuhei Kitagawa <shuheiktgw@users.noreply.github.com> Co-authored-by: rakuge <101624788+rakrueger@users.noreply.github.com> Co-authored-by: nikkie <takuyafjp+develop@gmail.com> Co-authored-by: Moritz Johner <moolen@users.noreply.github.com> Co-authored-by: Layer8Err <dwight.brenner@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laszlo Fogas <laszlo@gimlet.io>
2023-08-24 10:26:25 +00:00
build-arch: "amd64 arm64 s390x"
build-platform: "linux/amd64,linux/arm64,linux/s390x"
tag-suffix: "" # distroless
- dockerfile: "Dockerfile.ubi"
build-args: "CGO_ENABLED=0"
build-arch: "amd64 arm64"
build-platform: "linux/amd64,linux/arm64"
tag-suffix: "-ubi"
- dockerfile: "Dockerfile.ubi"
build-args: "CGO_ENABLED=0 GOEXPERIMENT=boringcrypto"
build-arch: "amd64"
build-platform: "linux/amd64"
tag-suffix: "-ubi-boringssl"
with:
dockerfile: ${{ matrix.dockerfile }}
tag-suffix: ${{ matrix.tag-suffix }}
image-name: ghcr.io/${{ github.repository }}
build-platform: ${{ matrix.build-platform }}
build-args: ${{ matrix.build-args }}
build-arch: ${{ matrix.build-arch }}
ref: ${{ github.ref }}
secrets:
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}