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

GitHub workflows #369

Merged
merged 9 commits into from
Dec 7, 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
74 changes: 74 additions & 0 deletions .github/workflows/integration_block_storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Run Block Storage Integration Tests

on:
workflow_dispatch:
pull_request:
paths:
- '**BlockStorage**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/wallaby" ] # v2 is removed from xena
php_version: [ 8.1 ]
ubuntu_version: [ 20.04 ]
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} and run Block Storage integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2
- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v3
with:
path: |
/opt/stack/*
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
- name: Set env variables
run: |
{
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
echo OS_REGION=RegionOne
echo OS_REGION_NAME=RegionOne
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
echo OS_USERNAME=admin
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=BlockStorage

73 changes: 73 additions & 0 deletions .github/workflows/integration_compute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Run Compute Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**Compute**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/wallaby" ] # Cinder v2 is removed from xena
php_version: [ 8.1 ]
ubuntu_version: [ 20.04 ]
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} with Nova and run Compute integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2
- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v3
with:
path: |
/opt/stack/*
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
enabled_services: 's-account,s-container,s-object,s-proxy,s-bak'
- name: Set env variables
run: |
{
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
echo OS_REGION=RegionOne
echo OS_REGION_NAME=RegionOne
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
echo OS_USERNAME=admin
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=Compute

5 changes: 4 additions & 1 deletion .github/workflows/integration_identity.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Run Identity Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**Identity**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
Expand Down Expand Up @@ -58,7 +61,7 @@ jobs:
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=2
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/integration_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Run Images Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**Images**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/zed" ]
php_version: [ 8.1 ]
ubuntu_version: [ 20.04 ]
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} with Glance and run Images integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2
- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v3
with:
path: |
/opt/stack/*
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
- name: Set env variables
run: |
{
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
echo OS_REGION=RegionOne
echo OS_REGION_NAME=RegionOne
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
echo OS_USERNAME=admin
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=Images

72 changes: 72 additions & 0 deletions .github/workflows/integration_networking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Run Networking Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**Networking**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/zed" ]
php_version: [ 8.1 ]
ubuntu_version: [ 20.04 ]
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} with Neutron and run Networking integration tests with php ${{matrix.php_version}}
steps:
- uses: actions/checkout@v2
- name: get cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v3
with:
path: |
~/.php_cs.cache
${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.php_version }}-
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: curl
tools: composer:v2
coverage: none
- run: composer install --prefer-dist --no-interaction --no-progress
- name: Restore devstack cache
uses: actions/cache@v3
with:
path: |
/opt/stack/*
!/opt/stack/data
~/devstack/
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
- name: Deploy devstack
uses: EmilienM/devstack-action@v0.11
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
- name: Set env variables
run: |
{
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
echo OS_REGION=RegionOne
echo OS_REGION_NAME=RegionOne
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
echo OS_USERNAME=admin
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
- name: Execute integration tests
run: php ./tests/integration/run.php -s=Networking

5 changes: 4 additions & 1 deletion .github/workflows/integration_object_storage.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Run Object Storage Integration Tests
on:
workflow_dispatch:
pull_request:
paths:
- '**ObjectStore**'
- '**Common**'

jobs:
tests:
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
Expand Down Expand Up @@ -65,7 +68,7 @@ jobs:
echo OS_PASSWORD=secret
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
echo OS_PROJECT_NAME=admin
echo OS_RESIZE_FLAVOR=2
echo OS_RESIZE_FLAVOR=c1
echo OS_FLAVOR=1
echo OS_DOMAIN_ID=default
} >> "$GITHUB_ENV"
Expand Down
9 changes: 8 additions & 1 deletion tests/integration/BlockStorage/v2/CoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public function volumes()
require_once $this->sampleFile($replacements, 'volumes/get.php');
self::assertInstanceOf(Volume::class, $volume);

$replacements += ['{newName}' => $this->randomStr(), '{newDescription}' => $this->randomStr()];
$replacements += [
'{newName}' => $this->randomStr(),
'{newDescription}' => $this->randomStr()
];

$this->logStep('Updating volume');
/** @var Volume $volume */
Expand All @@ -79,6 +82,8 @@ public function volumes()
/** @var \Generator $volumes */
require_once $this->sampleFile($replacements, 'volumes/list.php');

$volume->waitUntil('available');

$this->logStep('Deleting volume');
require_once $this->sampleFile($replacements, 'volumes/delete.php');

Expand Down Expand Up @@ -176,6 +181,8 @@ public function snapshots()
$this->logStep('Updating snapshot');
require_once $this->sampleFile($replacements, 'snapshots/update.php');

$snapshot->waitUntil('available', 60);

$this->logStep('Deleting snapshot');
require_once $this->sampleFile($replacements, 'snapshots/delete.php');
$snapshot->waitUntilDeleted();
Expand Down
Loading