Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI 1.15 #854

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
24 changes: 10 additions & 14 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 @@ -68,7 +63,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 @@ -106,15 +101,16 @@ jobs:
dir_ktools: ${{ github.workspace }}/ktools

branch_platform: ${{ github.ref_name }}
branch_oasislmf: '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 @@ -135,8 +131,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 @@ -442,7 +438,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
33 changes: 18 additions & 15 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 @@ -48,8 +44,8 @@ jobs:
docker_push: true
ignore_unfixed: true
cve_severity: ${{ github.event_name != 'workflow_dispatch' && 'CRITICAL' || 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
15 changes: 4 additions & 11 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 Down Expand Up @@ -47,11 +45,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 @@ -4,7 +4,7 @@
[![ktools version](https://img.shields.io/github/tag/Oasislmf/ktools?label=ktools)](https://github.com/OasisLMF/ktools/releases)
[![PyPI version](https://badge.fury.io/py/oasislmf.svg)](https://badge.fury.io/py/oasislmf)

# 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
Loading