Feature/1097 track subtask retries #1740
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: Platform Image Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- stable** | |
workflow_dispatch: | |
inputs: | |
last_release: | |
description: "Test backwards compatibility with platform ver [semvar]" | |
required: false | |
piwind_branch: | |
description: "Check Results from Piwind branch [git ref]" | |
required: true | |
default: 'main' | |
pytest_options: | |
description: "Pytest optional args [-k <test_name>]" | |
required: false | |
cve_severity: | |
description: 'Severities of vulnerabilities to scanned for [LOW, MEDIUM, HIGH, CRITICAL, SKIP]' | |
required: false | |
oasislmf_branch: | |
description: 'If set, pip install oasislmf branch [git ref]' | |
required: false | |
ods_branch: | |
description: 'If set, pip install ods-tools branch [git ref]' | |
required: false | |
env: | |
pre_release: 'true' # look for pre-release when testing last released platform version | |
semver_major: '2' # Search for published images but limited to {semvar_major}.x.x | |
#semver_minor: '27' # Search for published images but limited to x.{semvar_minor}.x | |
jobs: | |
build_images: | |
uses: ./.github/workflows/build-images.yml | |
secrets: inherit | |
with: | |
docker_push: true | |
ignore_unfixed: true | |
#cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL,HIGH' || inputs.cve_severity }} | |
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'SKIP' || inputs.cve_severity }} | |
oasislmf_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.oasislmf_branch }} | |
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }} | |
setup: | |
runs-on: ubuntu-latest | |
needs: [build_images] | |
outputs: | |
pytest_opts: ${{ steps.pytest.outputs.opts }} | |
piwind_branch: ${{ steps.piwind.outputs.branch }} | |
release_tag: ${{ steps.released_images.outputs.prev_release_tag }} | |
release_stable_1-15: ${{ steps.released_images.outputs.stable_1-15 }} | |
release_stable_1-23: ${{ steps.released_images.outputs.stable_1-23 }} | |
release_stable_1-27: ${{ steps.released_images.outputs.stable_1-27 }} | |
release_stable_1-28: ${{ steps.released_images.outputs.stable_1-28 }} | |
release_stable_2-3: ${{ steps.released_images.outputs.stable_2-3 }} | |
build_server_img: ${{ steps.built_images.outputs.server_img }} | |
build_server_tag: ${{ steps.built_images.outputs.server_tag }} | |
build_worker_img: ${{ steps.built_images.outputs.worker_img }} | |
build_worker_tag: ${{ steps.built_images.outputs.worker_tag }} | |
build_deb_worker_img: ${{ steps.built_images.outputs.deb_worker_img }} | |
build_deb_worker_tag: ${{ steps.built_images.outputs.deb_worker_tag }} | |
steps: | |
- name: Checkout Platform | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Load latest release tag | |
id: released_images | |
run: | | |
# Find the latest release tag only from current branch | |
if [[ "${{ github.ref_name }}" == backports/ ]]; then | |
tag=$( ./scripts/find_release.sh -p "${{ env.pre_release }}") | |
echo "prev_release_tag=$tag" >> $GITHUB_OUTPUT | |
# Find tags release accross all branches, limited to matching semver | |
elif [[ -z "${{ inputs.last_release }}" ]]; then | |
tag=$( ./scripts/find_latest.sh -j "${{ env.semver_major }}" -i "${{ env.semver_minor }}" ) | |
echo "prev_release_tag=$tag" >> $GITHUB_OUTPUT | |
# Don't search, use the given input | |
else | |
echo "prev_release_tag=${{ inputs.last_release }}" >> $GITHUB_OUTPUT | |
fi | |
# Find latest LTS from each stable branch | |
stable_1_15=$( ./scripts/find_latest.sh -j 1 -i 15 ) | |
echo "stable_1-15=$stable_1_15" >> $GITHUB_OUTPUT | |
stable_1_23=$( ./scripts/find_latest.sh -j 1 -i 23 ) | |
echo "stable_1-23=$stable_1_23" >> $GITHUB_OUTPUT | |
stable_1_27=$( ./scripts/find_latest.sh -j 1 -i 27 ) | |
echo "stable_1-27=$stable_1_27" >> $GITHUB_OUTPUT | |
stable_1_28=$( ./scripts/find_latest.sh -j 1 -i 28 ) | |
echo "stable_1-28=$stable_1_28" >> $GITHUB_OUTPUT | |
stable_2_3=$( ./scripts/find_latest.sh -j 2 -i 3 ) | |
echo "stable_2-3=$stable_2_3" >> $GITHUB_OUTPUT | |
- name: Select PiWind branch | |
id: piwind | |
run: | | |
# Select matching base branch on piwind | |
if [[ "${{ github.event_name }}" = "pull_request" ]]; then | |
BRANCH=${{ github.base_ref }} | |
if [[ ! $BRANCH == stable/* ]]; then | |
BRANCH='main' | |
fi | |
elif [[ "${{ github.event_name }}" = "push" ]]; then | |
BRANCH=${{ github.ref_name }} | |
else | |
BRANCH=${{ inputs.piwind_branch }} | |
fi | |
echo "branch=$BRANCH" >> $GITHUB_OUTPUT | |
- name: Select Pytest Options | |
id: pytest | |
run: | | |
if [[ -z "${{ inputs.pytest_options }}" ]]; then | |
echo "opts='-k case_1'" >> $GITHUB_OUTPUT | |
else | |
echo "opts=${{ inputs.pytest_options }}" >> $GITHUB_OUTPUT | |
fi | |
# Split ouput strings from build job | |
- name: Load built images | |
id: built_images | |
run: | | |
server_img=$(echo ${{ needs.build_images.outputs.server_image }} | awk '{split($0,a,":"); print a[1];}') | |
server_tag=$(echo ${{ needs.build_images.outputs.server_image }} | awk '{split($0,a,":"); print a[2];}') | |
echo "server_img=$server_img" >> $GITHUB_OUTPUT | |
echo "server_tag=$server_tag" >> $GITHUB_OUTPUT | |
worker_img=$(echo ${{ needs.build_images.outputs.worker_image }} | awk '{split($0,a,":"); print a[1];}') | |
worker_tag=$(echo ${{ needs.build_images.outputs.worker_image }} | awk '{split($0,a,":"); print a[2];}') | |
echo "worker_img=$worker_img" >> $GITHUB_OUTPUT | |
echo "worker_tag=$worker_tag" >> $GITHUB_OUTPUT | |
deb_worker_img=$(echo ${{ needs.build_images.outputs.worker_deb_image }} | awk '{split($0,a,":"); print a[1];}') | |
deb_worker_tag=$(echo ${{ needs.build_images.outputs.worker_deb_image }} | awk '{split($0,a,":"); print a[2];}') | |
echo "deb_worker_img=$deb_worker_img" >> $GITHUB_OUTPUT | |
echo "deb_worker_tag=$deb_worker_tag" >> $GITHUB_OUTPUT | |
all_checks_v1: | |
name: V1 all checks | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: ${{ needs.setup.outputs.piwind_branch }} | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: ${{ needs.setup.outputs.build_worker_img }} | |
worker_tag: ${{ needs.setup.outputs.build_worker_tag }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml " | |
storage_suffix: '-all-checks-v1' | |
all_checks_v2: | |
name: V2 all checks | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: ${{ needs.setup.outputs.piwind_branch }} | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: ${{ needs.setup.outputs.build_worker_img }} | |
worker_tag: ${{ needs.setup.outputs.build_worker_tag }} | |
worker_api_ver: 'v2' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml " | |
storage_suffix: '-all-checks-v2' | |
storage_s3_v1: | |
name: V1 Storage Compatibility (S3) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: ${{ needs.setup.outputs.piwind_branch }} | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: ${{ needs.setup.outputs.build_worker_img }} | |
worker_tag: ${{ needs.setup.outputs.build_worker_tag }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.s3.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: '_s3-v1' | |
storage_s3_v2: | |
name: V2 Storage Compatibility (S3) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: ${{ needs.setup.outputs.piwind_branch }} | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: ${{ needs.setup.outputs.build_worker_img }} | |
worker_tag: ${{ needs.setup.outputs.build_worker_tag }} | |
worker_api_ver: 'v2' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.s3.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: '_s3-v2' | |
worker_debian: | |
name: Worker Debian | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: ${{ needs.setup.outputs.piwind_branch }} | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: ${{ needs.setup.outputs.build_deb_worker_img }} | |
worker_tag: ${{ needs.setup.outputs.build_deb_worker_tag }} | |
worker_api_ver: 'v2' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: '-worker-debian' | |
stable_compatibility_1-15: | |
name: Test stable worker (${{ needs.setup.outputs.release_stable_1-15 }}) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: 'stable/1.15.x' | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: 'coreoasis/model_worker' | |
worker_tag: ${{ needs.setup.outputs.release_stable_1-15 }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_1-15 }}" | |
stable_compatibility_1-23: | |
name: Test stable worker (${{ needs.setup.outputs.release_stable_1-23 }}) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: 'stable/1.23.x' | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: 'coreoasis/model_worker' | |
worker_tag: ${{ needs.setup.outputs.release_stable_1-23 }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_1-23 }}" | |
stable_compatibility_1-27: | |
name: Test stable worker (${{ needs.setup.outputs.release_stable_1-27 }}) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: 'stable/1.27.x' | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: 'coreoasis/model_worker' | |
worker_tag: ${{ needs.setup.outputs.release_stable_1-27 }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_1-27 }}" | |
stable_compatibility_1-28: | |
name: test stable worker (${{ needs.setup.outputs.release_stable_1-28 }}) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: 'stable/1.28.x' | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: 'coreoasis/model_worker' | |
worker_tag: ${{ needs.setup.outputs.release_stable_1-28 }} | |
worker_api_ver: 'v1' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_1-28 }}" | |
stable_compatibility_2-3: | |
name: test stable worker (${{ needs.setup.outputs.release_stable_2-3 }}) | |
secrets: inherit | |
needs: [setup] | |
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main | |
with: | |
piwind_branch: 'stable/2.3.x' | |
server_image: ${{ needs.setup.outputs.build_server_img }} | |
server_tag: ${{ needs.setup.outputs.build_server_tag }} | |
worker_image: 'coreoasis/model_worker' | |
worker_tag: ${{ needs.setup.outputs.release_stable_2-3 }} | |
worker_api_ver: 'v2' | |
debug_mode: 1 | |
pytest_opts: "--docker-compose=./docker/plat2-v2.docker-compose.yml ${{ needs.setup.outputs.pytest_opts }}" | |
storage_suffix: "_worker-${{ needs.setup.outputs.release_stable_2-3 }}" | |