Skip to content

Commit

Permalink
Feautre/1323 reorganize branches plat1 (#850)
Browse files Browse the repository at this point in the history
* update readme title

* Update CI plat1

* Fix piwind branch select

* Updated Package Requirements: pyYaml==5.3.1

* Revert "Updated Package Requirements: pyYaml==5.3.1"

This reverts commit 094bcda.

* fix

* bump minor version for testing

---------

Co-authored-by: awsbuild <[email protected]>
  • Loading branch information
sambles and awsbuild committed Jul 18, 2023
1 parent 9b96faf commit d7d59e2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 59 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ name: Platform Schema (OpenAPI)
on:
push:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
pull_request:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
workflow_dispatch:
inputs:
ods_branch:
Expand All @@ -26,10 +24,10 @@ on:
jobs:
ods_tools:
if: inputs.ods_branch != ''
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@develop
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@main
secrets: inherit
with:
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'main' || inputs.ods_branch }}

schema:
if: ${{ ! failure() || ! cancelled() }}
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Platform Release
on:
workflow_dispatch:
inputs:
#pre_release:
# description: 'Mark GitHub release as pre-release'
# required: false
# type: boolean

push_latest:
description: 'Push images with the "latest" tag'
required: false
Expand All @@ -19,7 +14,7 @@ on:

piwind_branch:
description: 'Branch to build piwind from'
default: 'develop'
default: 'main'
required: true

prev_release_tag:
Expand Down Expand Up @@ -77,7 +72,7 @@ jobs:


build_piwind:
uses: OasisLMF/OasisPiWind/.github/workflows/build.yml@master
uses: OasisLMF/OasisPiWind/.github/workflows/build.yml@main
secrets: inherit
needs: build_images
with:
Expand Down Expand Up @@ -120,16 +115,16 @@ jobs:
dir_ktools: ${{ github.workspace }}/ktools

branch_platform: ${{ github.ref_name }}
branch_oasislmf: 'master'
branch_ods_tools: 'master'
branch_ktools: 'master'
branch_oasislmf: 'main'
branch_ods_tools: 'main'
branch_ktools: 'main'

steps:
## RELEASE CHECKS
- name: check branchname is valid for release
if: ${{ !startsWith(github.ref_name , 'release/') && !startsWith(github.ref_name, 'backports/') }}
if: ${{ !startsWith(github.ref_name , 'release/') && !startsWith(github.ref_name, 'stable/') }}
run: |
echo "Releases must be trigged on branchs 'release/x.x.x' or 'backports/x.x.x' "
echo "Releases must be trigged on branchs 'release/x.x.x' or 'stable/x.x.x' "
exit 1
- name: Check tag is valid for release
Expand All @@ -150,8 +145,8 @@ jobs:
exit 1
fi
- name: set Oasislmf to backports
if: startsWith(github.ref_name, 'backports/')
- name: set Oasislmf to stable
if: startsWith(github.ref_name, 'stable/')
run: echo "branch_oasislmf=${{ env.branch_platform }}" >> $GITHUB_ENV

## CLONE REPOS (plat / oasislmf / ktools / UI)
Expand Down Expand Up @@ -504,7 +499,7 @@ jobs:
# --- Notify Slack --- #
slack:
uses: OasisLMF/OasisLMF/.github/workflows/notify.yml@master
uses: OasisLMF/OasisLMF/.github/workflows/notify.yml@main
secrets: inherit
needs: release
with:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ name: Platform Vulnerability Scanning
on:
push:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
pull_request:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
schedule:
- cron: '0 */6 * * *' # Run scan every 6 hours

Expand Down
35 changes: 19 additions & 16 deletions .github/workflows/test-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ name: Platform Image Tests
on:
push:
branches:
- master
- develop
- backports**

- main-platform1
- stable**
pull_request:
branches:
- master
- develop
- backports**

- main-platform1
- stable**
workflow_dispatch:
inputs:
last_release:
Expand All @@ -21,7 +17,7 @@ on:
piwind_branch:
description: "Check Results from Piwind branch [git ref]"
required: true
default: 'develop'
default: 'main'
pytest_options:
description: "Pytest optional args [-k <test_name>]"
required: false
Expand All @@ -38,7 +34,7 @@ on:
env:
pre_release: 'true' # look for pre-release when testing last released platform version
semver_major: '1' # 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
semver_minor: '28' # Search for published images but limited to x.{semvar_minor}.x

jobs:
build_images:
Expand All @@ -48,8 +44,8 @@ jobs:
docker_push: true
ignore_unfixed: true
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL,HIGH' || inputs.cve_severity }}
oasislmf_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.oasislmf_branch }}
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
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
Expand Down Expand Up @@ -90,15 +86,22 @@ jobs:
- name: Select PiWind branch
id: piwind
run: |
# Select matching base branch on piwind
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
BRANCH=${{ github.base_ref }}
elif [[ "${{ github.event_name }}" = "push" ]]; then
BRANCH=${{ github.ref_name }}
else
BRANCH=${{ inputs.piwind_branch }}
fi
#override 'main-platform1' -> 'main'
if [[ "$BRANCH" = 'main-platform1' ]]; then
BRANCH=main
fi
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
- name: Select Pytest Options
id: pytest
run: |
Expand Down Expand Up @@ -131,7 +134,7 @@ jobs:
name: Server Compatibility (${{ needs.setup.outputs.release_tag }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@master
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
Expand All @@ -146,7 +149,7 @@ jobs:
name: Worker Debian
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
Expand All @@ -161,7 +164,7 @@ jobs:
name: Worker Compatibility (${{ needs.setup.outputs.release_tag }})
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: 'coreoasis/api_server'
Expand All @@ -176,7 +179,7 @@ jobs:
name: Storage Compatibility (S3)
secrets: inherit
needs: [setup]
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@develop
uses: OasisLMF/OasisPiWind/.github/workflows/integration.yml@main
with:
piwind_branch: ${{ needs.setup.outputs.piwind_branch }}
server_image: ${{ needs.setup.outputs.build_server_img }}
Expand Down
19 changes: 6 additions & 13 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ name: Platform Python Tests
on:
push:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
pull_request:
branches:
- master
- develop
- backports**
- main-platform1
- stable**
workflow_dispatch:
inputs:
ods_branch:
Expand All @@ -20,10 +18,10 @@ on:
jobs:
ods_tools:
#if: inputs.ods_branch != ''
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@develop
uses: OasisLMF/ODS_Tools/.github/workflows/build.yml@main
secrets: inherit
with:
ods_branch: ${{ github.event_name != 'workflow_dispatch' && 'develop' || inputs.ods_branch }}
ods_branch: ${{ inputs.ods_branch == '' && 'main' || inputs.ods_branch }}

unittest:
needs: ods_tools
Expand Down Expand Up @@ -55,11 +53,6 @@ jobs:
- name: Run Pytest
run: pytest --cov-config=tox.ini --junitxml=${{ github.workspace }}/pytest_report.xml --cov=src --cov-report=xml --cov-report=term

# - name: Run Tox
# run: |
# pip install tox
# tox -e py

- name: Generate Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Platform Python tests](https://github.com/OasisLMF/OasisPlatform/actions/workflows/test-python.yml/badge.svg?branch=master)](https://github.com/OasisLMF/OasisPlatform/actions/workflows/test-python.yml)
[![Platform Vulnerability Scanning](https://github.com/OasisLMF/OasisPlatform/actions/workflows/scan.yml/badge.svg?branch=master)](https://github.com/OasisLMF/OasisPlatform/actions/workflows/scan.yml)

# Oasis Platform
# Oasis Platform 1
Provides core components of the Oasis platform, specifically:
* DJango application that provides the Oasis REST API
* Celery worker for running a model
Expand Down

0 comments on commit d7d59e2

Please sign in to comment.