Remove specific image override for storage version migration #8653
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: Validate | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release-*' | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: | |
- 'main' | |
- 'release-*' | |
schedule: | |
- cron: "0 6 * * *" # Daily at 06:00. | |
workflow_dispatch: # Manual workflow trigger | |
jobs: | |
generated-files-committed: | |
name: Generated files are committed | |
runs-on: ubuntu-latest | |
env: | |
GOPATH: ${{ github.workspace }} | |
steps: | |
- name: Setup Golang | |
uses: openshift-knative/hack/actions/setup-go@main | |
- name: Install yq | |
run: | | |
go install github.com/mikefarah/yq/v3@latest | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: ./src/github.com/${{ github.repository }} | |
fetch-depth: 0 | |
- name: Merge upstream | |
if: github.event_name == 'pull_request' | |
working-directory: ./src/github.com/${{ github.repository }} | |
run: | | |
if ! git config user.name > /dev/null; then | |
git config user.name "John Doe" | |
fi | |
if ! git config user.email > /dev/null; then | |
git config user.email "johndoe@localhost" | |
fi | |
git remote add upstream https://github.com/${{ github.repository }}.git | |
git pull --no-rebase upstream ${{ github.base_ref }} | |
shell: bash | |
- name: Set CURRENT_VERSION_IMAGES | |
working-directory: ./src/github.com/${{ github.repository }} | |
if: (github.event_name == 'pull_request' && github.base_ref != 'main') || ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name != 'main') | |
run: | | |
tag="release-$(yq read ./olm-catalog/serverless-operator/project.yaml 'project.version')" | |
echo "CURRENT_VERSION_IMAGES=${tag}" >> $GITHUB_ENV | |
shell: bash | |
- name: Regenerate all generated files | |
working-directory: ./src/github.com/${{ github.repository }} | |
run: make generated-files | |
# Optional: | |
# Since we're generating files based on a floating branch in midstream, | |
# we need to reconcile those files periodically. | |
# | |
# when it's manually triggered or a scheduled run. | |
- name: Create Pull Request | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || ( github.event_name == 'push' && !contains(github.ref_name, 'dependabot/') ) | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
path: ./src/github.com/${{ github.repository }} | |
branch: auto/update-generated-files-${{ github.ref_name }} | |
title: "[${{ github.ref_name }}] Run make generated-files" | |
commit-message: "Run make generated-files" | |
delete-branch: true | |
body: | | |
Generated by running `make generated-files` | |
- name: Check if everything is consistent | |
working-directory: ./src/github.com/${{ github.repository }} | |
run: ./hack/verify-diff.sh | |
- name: Check existence of skipRange and replaces in ClusterServiceVersion | |
working-directory: ./src/github.com/${{ github.repository }} | |
run: | | |
csv="olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml" | |
if [[ "$(GOFLAGS='' go run github.com/mikefarah/yq/v3@latest read "$csv" spec.replaces)" == "" || \ | |
"$(GOFLAGS='' go run github.com/mikefarah/yq/v3@latest read "$csv" 'metadata.annotations."olm.skipRange"')" == "" ]]; then | |
echo '::error:: Missing spec.replaces or metadata.annotations."olm.skipRange" in CSV.' | |
exit 34 | |
fi | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
env: | |
GOPATH: ${{ github.workspace }} | |
steps: | |
- name: Setup Golang | |
uses: openshift-knative/hack/actions/setup-go@main | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: ./src/github.com/${{ github.repository }} | |
- name: Install Tools | |
working-directory: ./src/github.com/${{ github.repository }} | |
env: | |
WOKE_VERSION: v0.13.0 | |
OSDK_VERSION: v1.12.0 | |
run: | | |
TEMP_PATH="$(mktemp -d)" | |
cd $TEMP_PATH | |
echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' | |
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" 2>&1 | |
echo '::endgroup::' | |
echo '::group:: Installing misspell ... https://github.com/client9/misspell' | |
go install github.com/client9/misspell/cmd/misspell@latest | |
echo '::endgroup::' | |
echo '::group:: Installing woke ... https://github.com/get-woke/woke' | |
curl -sfL https://raw.githubusercontent.com/get-woke/woke/main/install.sh | sh -s -- -b "${TEMP_PATH}" "${WOKE_VERSION}" 2>&1 | |
echo '::endgroup::' | |
echo '::group:: Installing operator-sdk ... https://github.com/operator-framework/operator-sdk/' | |
curl -sfL https://github.com/operator-framework/operator-sdk/releases/download/${OSDK_VERSION}/operator-sdk_linux_amd64 -o "${TEMP_PATH}/operator-sdk" | |
chmod +x "${TEMP_PATH}/operator-sdk" | |
echo "${TEMP_PATH}" >> $GITHUB_PATH | |
- name: Shellcheck | |
working-directory: ./src/github.com/${{ github.repository }} | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
run: | | |
find . -type f \ | |
-path './**/*.*sh' \ | |
-not -path '*vendor*' | xargs -r shellcheck --format=checkstyle \ | |
| reviewdog -f=checkstyle \ | |
-name="shellcheck" \ | |
-reporter="github-pr-check" \ | |
-filter-mode="added" \ | |
-fail-on-error="true" \ | |
-level="error" | |
- name: Go Lint - knative-operator | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.61.0 | |
args: --timeout=10m0s --verbose | |
working-directory: ./src/github.com/${{ github.repository }} | |
# This is mostly copied from https://github.com/get-woke/woke-action-reviewdog/blob/main/entrypoint.sh | |
# since their action is not yet released under a stable version. | |
- name: Language | |
if: ${{ always() && github.event_name == 'pull_request' }} | |
working-directory: ./src/github.com/${{ github.repository }} | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
run: | | |
woke --output simple \ | |
| reviewdog -efm="%f:%l:%c: %m" \ | |
-name="woke" \ | |
-reporter="github-pr-check" \ | |
-filter-mode="added" \ | |
-fail-on-error="true" \ | |
-level="error" | |
- name: OLM Bundle | |
working-directory: ./src/github.com/${{ github.repository }} | |
run: | | |
operator-sdk bundle validate ./olm-catalog/serverless-operator --select-optional suite=operatorframework --optional-values=k8s-version=1.22 | |
- name: Spelling | |
working-directory: ./src/github.com/${{ github.repository }} | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} | |
run: | | |
# Don't fail because of misspell | |
set +o pipefail | |
git ls-files | grep -Ev '^(vendor/|.git)' | xargs misspell -i importas -error \ | |
| reviewdog -efm="%f:%l:%c: %m" \ | |
-name="github.com/client9/misspell" \ | |
-reporter="github-pr-check" \ | |
-filter-mode="added" \ | |
-fail-on-error="true" \ | |
-level="error" | |
- name: Prettify code | |
uses: creyD/prettier_action@v4.3 | |
with: | |
dry: true | |
prettier_options: --check src/github.com/${{ github.repository }}/templates/*.yaml |