Skip to content

CI: split PR workflows, add paths #708

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

Closed
wants to merge 24 commits into from
Closed
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
22 changes: 22 additions & 0 deletions .github/path-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is a list of path filters for the PR workflow in .github/workflows/stackhpc-pull-request.yml.
aio:
- '.automation'
- '.automation.conf/config.sh'
- '.automation.conf/tempest/load-lists/default'
- '.automation.conf/tempest/load-lists/platform.2022.11-test-list.txt'
- '.automation.conf/tempest/load-lists/refstack-2019.11-test-list.txt'
- '.automation.conf/tempest/tempest-ci-aio.overrides.conf'
#- '.github/workflows/stackhpc-all-in-one.yml'
#- '.github/workflows/stackhpc-build-kayobe-image.yml'
#- '.github/workflows/stackhpc-pull-request.yml'
- 'etc/kayobe/*.yml'
- 'etc/kayobe/ansible/configure-aio-resources.yml'
- 'etc/kayobe/ansible/growroot.yml'
- 'etc/kayobe/ansible/requirements.yml'
- 'etc/kayobe/ansible/scripts/aio-init.sh'
- 'etc/kayobe/environments/ci-aio/**'
- 'etc/kayobe/inventory/**'
- 'etc/kayobe/kolla/**'
- 'kayobe-env'
- 'requirements.txt'
- 'terraform/aio/**'
8 changes: 8 additions & 0 deletions .github/workflows/stackhpc-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ on:
description: Name of cloud in clouds.yaml
type: string
required: true
if:
description: Whether to run the workflow (workaround for required status checks issue)
type: boolean
default: true
secrets:
KAYOBE_VAULT_PASSWORD:
required: true
Expand All @@ -57,13 +61,17 @@ jobs:
# NOTE: Runner needs unzip and nodejs packages.
all-in-one:
name: All in one
#if: inputs.if
runs-on: [self-hosted, stackhpc-kayobe-config-aio]
permissions: {}
env:
KAYOBE_ENVIRONMENT: ci-aio
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
KAYOBE_IMAGE: ${{ inputs.kayobe_image }}
steps:
- name: Fail
run: false

- uses: actions/checkout@v3
with:
submodules: true
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/stackhpc-build-kayobe-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
no_proxy:
type: string
required: false
if:
description: Whether to run the workflow (workaround for required status checks issue)
type: boolean
default: true
outputs:
kayobe_image:
description: Reference of Kayobe image that was built
Expand All @@ -28,6 +32,7 @@ env:
jobs:
build-kayobe-image:
name: Build kayobe image
#if: inputs.if
runs-on: ubuntu-20.04
permissions:
contents: read
Expand Down
62 changes: 55 additions & 7 deletions .github/workflows/stackhpc-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,29 @@ name: Pull request
'on':
pull_request:
jobs:
# Detect which files have changed and use this to run jobs conditionally.
# Note that we can't use the workflow-level paths attribute since this
# would skip the workflow entirely, and would prevent us from making the
# aio jobs required to pass (a skip counts as a pass).
check-changes:
runs-on: ubuntu-20.04
permissions:
pull-requests: read
name: Check changed files
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
outputs:
aio: ${{ steps.changes.outputs.aio }}
steps:
- name: GitHub Checkout
uses: actions/checkout@v3

- name: Check changed files
uses: dorny/paths-filter@v2
id: changes
with:
# Filters are defined in this file.
filters: .github/path-filters.yml

tox:
runs-on: ubuntu-20.04
permissions: {}
Expand Down Expand Up @@ -36,36 +59,55 @@ jobs:

build-kayobe-image:
name: Build Kayobe Image
needs:
- check-changes
uses: ./.github/workflows/stackhpc-build-kayobe-image.yml
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
with:
if: ${{ needs.check-changes.outputs.aio == 'true' }}

test:
runs-on: ubuntu-20.04
needs:
- check-changes
- build-kayobe-image
if: always()
steps:
- run: echo '${{ toJson(needs.build-kayobe-image) }}'
- run: echo '${{ toJson(needs.build-kayobe-image.result) }}'
- run: echo '${{ toJson(needs.build-kayobe-image.outputs) }}'

all-in-one-centos-ovs:
name: aio (CentOS OVS)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
neutron_plugin: ovs
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
if: ${{ ! failure() }}

all-in-one-centos-ovn:
name: aio (CentOS OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
neutron_plugin: ovn
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
if: ${{ ! failure() }}

all-in-one-rocky-ovs:
name: aio (Rocky OVS)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
Expand All @@ -77,12 +119,14 @@ jobs:
vm_image: Rocky8-2022-11-08
vm_interface: ens3
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
if: ${{ ! failure() }}

all-in-one-rocky-ovn:
name: aio (Rocky OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
Expand All @@ -94,12 +138,14 @@ jobs:
vm_image: Rocky8-2022-11-08
vm_interface: ens3
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
if: ${{ ! failure() }}

all-in-one-ubuntu-ovs:
name: aio (Ubuntu OVS)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
Expand All @@ -108,12 +154,13 @@ jobs:
neutron_plugin: ovs
vm_image: Ubuntu-20.04
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'

all-in-one-ubuntu-ovn:
name: aio (Ubuntu OVN)
needs:
- check-changes
- build-kayobe-image
uses: ./.github/workflows/stackhpc-all-in-one.yml
with:
Expand All @@ -122,5 +169,6 @@ jobs:
neutron_plugin: ovn
vm_image: Ubuntu-20.04
OS_CLOUD: sms-lab-release
if: ${{ needs.check-changes.outputs.aio == 'true' }}
secrets: inherit
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
if: ${{ ! failure() }}