This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
Remote secret rejected data upload metric #533
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
# | |
# Copyright (c) 2021 Red Hat, Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Validate PRs | |
on: | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
go: | |
name: Check sources | |
runs-on: ubuntu-latest | |
env: | |
OPERATOR_SDK_VERSION: v1.28.1 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Cache Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
uses: actions/cache@v3 | |
id: cache-operator-sdk | |
with: | |
path: ~/cache | |
key: operator-sdk-${{ env.OPERATOR_SDK_VERSION }} | |
- name: Download Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
if: steps.cache-operator-sdk.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/cache | |
wget https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64 -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null | |
chmod +x ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} | |
- name: Install Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
run: | | |
mkdir -p ~/bin | |
cp ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} ~/bin/operator-sdk | |
echo "$HOME/bin" >> $GITHUB_PATH | |
- name: Cache go modules | |
id: cache-mod | |
uses: actions/cache@v3 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Download dependencies | |
run: go mod download | |
if: steps.cache-mod.outputs.cache-hit != 'true' | |
- name: Check go mod status | |
run: | | |
go mod tidy | |
if [[ ! -z $(git status -s) ]] | |
then | |
echo "Go mod state is not clean:" | |
git --no-pager diff | |
exit 1 | |
fi | |
- name: Check format | |
run: | | |
go install github.com/google/addlicense@latest | |
go install golang.org/x/tools/cmd/goimports@latest | |
git reset HEAD --hard | |
make check_fmt | |
if [[ $? != 0 ]] | |
then | |
echo "not well formatted sources are found:" | |
git --no-pager diff | |
exit 1 | |
fi | |
- name: Check manifests | |
run: | | |
pip install yq | |
# Note: fmt is necessary after generate since generated sources will | |
# fail format check by default. | |
make generate fmt manifests | |
if [[ ! -z $(git status -s) ]] | |
then | |
echo "generated sources are not up to date:" | |
git --no-pager diff | |
exit 1 | |
fi | |
- name: Start Minikube | |
run: | | |
curl -LO https://storage.googleapis.com/minikube/releases/v1.27.0/minikube-linux-amd64 | |
sudo install minikube-linux-amd64 /usr/local/bin/minikube | |
minikube start --memory=4000mb | |
- name: Run Go Tests | |
env: | |
GOMEGA_DEFAULT_EVENTUALLY_TIMEOUT: 10s | |
run: | | |
python -m pip install --upgrade pip yq | |
make test | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
spi-check: | |
name: Check spi compatibility | |
runs-on: ubuntu-latest | |
env: | |
OPERATOR_SDK_VERSION: v1.28.1 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Check out SPI's code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
repository: 'redhat-appstudio/service-provider-integration-operator' | |
path: 'spi' | |
- name: Check SPI mod | |
run: | | |
sed -i '4 i replace github.com/redhat-appstudio/remote-secret => ../' ./spi/go.mod | |
cd spi | |
go mod tidy | |
cat go.mod | |
git diff | |
- name: Cache Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
uses: actions/cache@v3 | |
id: cache-operator-sdk | |
with: | |
path: ~/cache | |
key: operator-sdk-${{ env.OPERATOR_SDK_VERSION }} | |
- name: Download Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
if: steps.cache-operator-sdk.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/cache | |
wget https://github.com/operator-framework/operator-sdk/releases/download/${OPERATOR_SDK_VERSION}/operator-sdk_linux_amd64 -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null -O ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} > /dev/null | |
chmod +x ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} | |
- name: Install Operator SDK ${{ env.OPERATOR_SDK_VERSION }} | |
run: | | |
mkdir -p ~/bin | |
cp ~/cache/operator-sdk-${OPERATOR_SDK_VERSION} ~/bin/operator-sdk | |
echo "$HOME/bin" >> $GITHUB_PATH | |
- name: Start Minikube | |
run: | | |
curl -LO https://storage.googleapis.com/minikube/releases/v1.27.0/minikube-linux-amd64 | |
sudo install minikube-linux-amd64 /usr/local/bin/minikube | |
minikube start --memory=4000mb | |
- name: Run Go Tests | |
env: | |
GOMEGA_DEFAULT_EVENTUALLY_TIMEOUT: 10s | |
run: | | |
python -m pip install --upgrade pip yq | |
pwd | |
cd spi | |
make test | |
docker-controller: | |
name: Check controller docker image build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check if dockerimage build is working | |
run: docker build -f ./Dockerfile . |