Skip to content

Commit ce6c181

Browse files
Release-1.8.0
1 parent 5d19881 commit ce6c181

File tree

23 files changed

+494
-406
lines changed

23 files changed

+494
-406
lines changed

.github/actions/check-chart-locks/action.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,27 @@ runs:
3636
- name: Check lockfile for chart lock
3737
id: check-for-chart-lock
3838
shell: bash
39+
env:
40+
GENERATED_LOCKFILE_PATH: ${{ steps.generate-locks.outputs.lockfile-path }}
41+
TARGET_CHART_NAME: ${{ inputs.chart-name }}
3942
run: |
4043
set -e
4144
echo "Ensuring expected key exists in lock JSON."
42-
jq --exit-status .packages < ${{ steps.generate-locks.outputs.lockfile-path }}
45+
jq --exit-status .packages < "${GENERATED_LOCKFILE_PATH}"
4346
44-
echo "Checking if chart '${{ inputs.chart-name }}' is locked."
45-
LOCK_PATH=$(jq -r '.packages."${{ inputs.chart-name }}"' < ${{ steps.generate-locks.outputs.lockfile-path }})
47+
echo "Checking if chart \"${TARGET_CHART_NAME}\" is locked."
48+
LOCK_TARGET=$(jq -r '.packages.[$chartname]' --arg chartname "${TARGET_CHART_NAME}" < "${GENERATED_LOCKFILE_PATH}")
4649
47-
echo "locked-to-path=${LOCK_PATH}" | tee -a $GITHUB_OUTPUT
50+
echo "locked-to-path=${LOCK_TARGET}" | tee -a $GITHUB_OUTPUT
4851
4952
# Defaults to a locked state as a safeguard.
5053
- name: Set lock state output
5154
shell: bash
5255
id: set-lock-state
56+
env:
57+
IS_LOCKED: ${{ steps.check-for-chart-lock.outputs.locked-to-path != 'null' }}
5358
run: |
54-
echo "chart-is-locked=${{ steps.check-for-chart-lock.outputs.locked-to-path != 'null' }}" | tee -a $GITHUB_OUTPUT
59+
echo "chart-is-locked=${IS_LOCKED}" | tee -a $GITHUB_OUTPUT
5560
5661
- name: Fail if requested and the chart is locked
5762
shell: bash

.github/actions/generate-chart-locks/action.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ runs:
6464
working-directory: temp-gen-chart-lock-repo
6565
id: generate-chart-locks
6666
shell: bash
67+
env:
68+
GENERATOR_CMD_PATH: ${{ inputs.generator-cmd-path }}
69+
OUT_FILE: ${{ inputs.to-file }}
6770
run: |
6871
set -eo pipefail
69-
${{ inputs.generator-cmd-path }} | jq | tee ${{ inputs.to-file }}
70-
echo "lockfile-path=$(realpath ${{ inputs.to-file }})" | tee -a $GITHUB_OUTPUT
72+
"${GENERATOR_CMD_PATH}" | jq | tee "${OUT_FILE}"
73+
echo "lockfile-path=$(realpath ${OUT_FILE})" | tee -a $GITHUB_OUTPUT
7174
- name: Cleanup
7275
id: cleanup
7376
if: always()

.github/actions/get-ocp-range/action.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ runs:
2323
- name: Run get-ocp-range
2424
id: run-get-ocp-range
2525
shell: bash
26+
env:
27+
KUBEVERSION_RANGE: ${{ inputs.kube-version-range }}
2628
run: |
27-
echo "::debug::Received kubeVersionRange to translate '${{ inputs.kube-version-range }}'"
28-
OCP_VERSION_RANGE=$(get-ocp-range '${{ inputs.kube-version-range }}')
29-
echo "ocp-version-range=$OCP_VERSION_RANGE" >> $GITHUB_OUTPUT
30-
echo "::debug::Successfully translated kubeVersionRange to OCPVersionRange $OCP_VERSION_RANGE"
29+
echo "::debug::Received kubeVersionRange to translate \"${KUBEVERSION_RANGE}\""
30+
OCP_VERSION_RANGE=$(get-ocp-range "${KUBEVERSION_RANGE}")
31+
echo "ocp-version-range=${OCP_VERSION_RANGE}" >> $GITHUB_OUTPUT
32+
echo "::debug::Successfully translated kubeVersionRange to OCPVersionRange ${OCP_VERSION_RANGE}"
3133
3234
- name: Display error message if get-ocp-range failed
3335
if: ${{ failure() && steps.run-get-ocp-range.outcome == 'failure' }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Install our CI scripts
2+
description: |
3+
Handles installation and caching/restore of the CI scripts in a virtualenv.
4+
inputs:
5+
working-directory:
6+
description: Basedir in which to save / restore cache and install venv.
7+
default: './'
8+
required: false
9+
python-version:
10+
description: Installed Python version
11+
required: true
12+
runs:
13+
using: composite
14+
steps:
15+
# This attempts to restore the virtualenv from a GitHub cache with the corresponding cache key.
16+
# On cache-miss, this automatically adds a post step that creates a cache from this path and using this cache key.
17+
- name: Cache virtualenv
18+
id: cache
19+
uses: actions/cache@v4
20+
with:
21+
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('scripts/requirements.txt') }}
22+
path: ${{ inputs.working-directory }}/ve1
23+
24+
- name: Setup venv on cache-miss
25+
if: steps.cache.outputs.cache-hit != 'true'
26+
shell: bash
27+
working-directory: ${{ inputs.working-directory }}
28+
run: |
29+
# set up python
30+
python3 -m venv ve1
31+
cd scripts
32+
../ve1/bin/pip3 install -r requirements.txt
33+
../ve1/bin/pip3 install .

.github/actions/setup-python/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ description: |
55
66
Serves as the single place to update python versions over time across the
77
project.
8+
outputs:
9+
python-version:
10+
description: Version of Python installed
11+
value: ${{ steps.setup-python.outputs.python-version }}
812
runs:
913
using: composite
1014
steps:
1115
- uses: actions/setup-python@v5
16+
id: setup-python
1217
with:
1318
python-version: '3.10'

.github/workflows/behave.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ on:
5656
for verifying the user is a trusted user.
5757
secrets:
5858
# bot-name is not technically secret, but must be listed as a secret
59-
# because you can't pass the ${{ secrets }} context as an input in the
59+
# because you can't pass GitHub's "secrets" context as an input in the
6060
# calling workflow, and our repos have this configured as a secret.
6161
bot-name:
6262
required: true
@@ -103,7 +103,7 @@ jobs:
103103
needs: [get-features]
104104
strategy:
105105
fail-fast: false
106-
max-parallel: 2
106+
max-parallel: 4
107107
matrix:
108108
feature-file: ${{ fromJson(needs.get-features.outputs.features) }}
109109
steps:
@@ -116,35 +116,36 @@ jobs:
116116
fetch-depth: ${{ inputs.checkout-fetch-depth }}
117117

118118
- name: Set up Python
119+
id: setup-python
119120
uses: ./.github/actions/setup-python
120121

121-
- name: Set up CI scripts
122-
run: |
123-
# set up python scripts
124-
echo "set up python script in $PWD"
125-
python3 -m venv ve1
126-
cd scripts
127-
../ve1/bin/pip3 install -r requirements.txt
128-
../ve1/bin/pip3 install .
129-
cd ..
122+
- name: Install CI scripts
123+
uses: ./.github/actions/install-ci-scripts
124+
with:
125+
python-version: ${{ steps.setup-python.outputs.python-version }}
130126

131127
# Pull request numbers are included in generated chart names in E2E, so it's included
132128
# as an environment variable which E2E consumes.
133129
- name: Populate PR_NUMBER environment variable
134130
if: github.event_name == 'pull_request_target' || github.event_name == 'pull_request'
131+
env:
132+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
135133
run: |
136-
echo "PR_NUMBER=${{ github.event.pull_request.number }}" | tee $GITHUB_ENV
134+
echo "PR_NUMBER=${GITHUB_PR_NUMBER}" | tee $GITHUB_ENV
137135
138136
- name: Run Tests
139137
env:
140138
GITHUB_TOKEN: ${{ secrets.github-token }}
141139
BOT_NAME: ${{ secrets.bot-name }}
142140
BOT_TOKEN: ${{ secrets.bot-token }}
143141
PR_BODY: ${{ inputs.pr-body }}
142+
FEATURE_FILE: ${{ matrix.feature-file }}
143+
INCLUDED_TAGS: ${{ inputs.tags }}
144+
BEHAVE_LOG_LEVEL: ${{ inputs.behave-logging-level }}
144145
run: |
145146
ve1/bin/behave tests/functional/behave_features/ \
146-
--include ${{ matrix.feature-file }} \
147-
--tags=${{ inputs.tags }} \
148-
--logging-level=${{ inputs.behave-logging-level }} \
147+
--include "${FEATURE_FILE}" \
148+
--tags="${INCLUDED_TAGS}" \
149+
--logging-level="${BEHAVE_LOG_LEVEL}" \
149150
--no-capture \
150151
--no-color

0 commit comments

Comments
 (0)