Skip to content

Commit cba8dc5

Browse files
authored
GitHub workflows (#368)
* fix tests for new Guzzle * run object store and identity integration tests * use CamelCase directories in samples for docs
1 parent ac606a4 commit cba8dc5

File tree

278 files changed

+338
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+338
-197
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run Identity Integration Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- '**Identity**'
6+
jobs:
7+
tests:
8+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
openstack_version: [ "stable/zed" ]
13+
php_version: [ 8.1 ]
14+
ubuntu_version: [ 20.04 ]
15+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
16+
name: Deploy OpenStack ${{ matrix.name }} and run Identity integration tests with php ${{matrix.php_version}}
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: get cache directory
20+
id: composer-cache
21+
run: |
22+
echo "::set-output name=dir::$(composer config cache-files-dir)"
23+
- uses: actions/cache@v3
24+
with:
25+
path: |
26+
~/.php_cs.cache
27+
${{ steps.composer-cache.outputs.dir }}
28+
key: ${{ runner.os }}-cache-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-composer-${{ matrix.php_version }}-
31+
- uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php_version }}
34+
extensions: curl
35+
tools: composer:v2
36+
coverage: none
37+
- run: composer install --prefer-dist --no-interaction --no-progress
38+
- name: Restore devstack cache
39+
uses: actions/cache@v3
40+
with:
41+
path: |
42+
/opt/stack/*
43+
!/opt/stack/data
44+
~/devstack/
45+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
46+
- name: Deploy devstack
47+
uses: EmilienM/devstack-action@v0.11
48+
with:
49+
branch: ${{ matrix.openstack_version }}
50+
- name: Set env variables
51+
run: |
52+
{
53+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
54+
echo OS_REGION=RegionOne
55+
echo OS_REGION_NAME=RegionOne
56+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
57+
echo OS_USERNAME=admin
58+
echo OS_PASSWORD=secret
59+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
60+
echo OS_PROJECT_NAME=admin
61+
echo OS_RESIZE_FLAVOR=2
62+
echo OS_FLAVOR=1
63+
echo OS_DOMAIN_ID=default
64+
} >> "$GITHUB_ENV"
65+
- name: Execute integration tests
66+
run: php ./tests/integration/run.php -s=Identity
67+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Run Object Storage Integration Tests
2+
on:
3+
pull_request:
4+
paths:
5+
- '**ObjectStore**'
6+
jobs:
7+
tests:
8+
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
openstack_version: [ "stable/zed" ]
13+
php_version: [ 8.1 ]
14+
ubuntu_version: [ 20.04 ]
15+
runs-on: ubuntu-${{ matrix.ubuntu_version }}
16+
name: Deploy OpenStack ${{ matrix.name }} and run ObjectStore integration tests with php ${{matrix.php_version}}
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: get cache directory
20+
id: composer-cache
21+
run: |
22+
echo "::set-output name=dir::$(composer config cache-files-dir)"
23+
- uses: actions/cache@v3
24+
with:
25+
path: |
26+
~/.php_cs.cache
27+
${{ steps.composer-cache.outputs.dir }}
28+
key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-composer-${{ matrix.php_version }}-
31+
- uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php_version }}
34+
extensions: curl
35+
tools: composer:v2
36+
coverage: none
37+
- run: composer install --prefer-dist --no-interaction --no-progress
38+
- name: Restore devstack cache
39+
uses: actions/cache@v3
40+
with:
41+
path: |
42+
/opt/stack/*
43+
!/opt/stack/data
44+
~/devstack/
45+
key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }}
46+
- name: Deploy devstack
47+
uses: EmilienM/devstack-action@v0.11
48+
with:
49+
branch: ${{ matrix.openstack_version }}
50+
conf_overrides: |
51+
SWIFT_ENABLE_TEMPURLS=True
52+
SWIFT_TEMPURL_KEY=secretkey
53+
[[post-config|\$SWIFT_CONFIG_PROXY_SERVER]]
54+
[filter:versioned_writes]
55+
allow_object_versioning = true
56+
enabled_services: 's-account,s-container,s-object,s-proxy'
57+
- name: Set env variables
58+
run: |
59+
{
60+
echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3"
61+
echo OS_REGION=RegionOne
62+
echo OS_REGION_NAME=RegionOne
63+
echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id)
64+
echo OS_USERNAME=admin
65+
echo OS_PASSWORD=secret
66+
echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id)
67+
echo OS_PROJECT_NAME=admin
68+
echo OS_RESIZE_FLAVOR=2
69+
echo OS_FLAVOR=1
70+
echo OS_DOMAIN_ID=default
71+
} >> "$GITHUB_ENV"
72+
- name: Execute integration tests
73+
run: php ./tests/integration/run.php -s=ObjectStore
74+

doc/services/block-storage/v2/volume-types.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Volume Types
33

44
Listing volume types
55
--------------------
6-
.. sample:: blockstoragev2/volume_types/list.php
6+
.. sample:: BlockStorage/v2/volume_types/list.php
77
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumeTypes
88

99
Each iteration will return a :php:class:`VolumeType` instance <OpenStack/BlockStorage/v2/Models/VolumeType.html>.
@@ -17,7 +17,7 @@ Create volume type
1717
The only attributes that are required when creating a volume are a name. The simplest example
1818
would therefore be this:
1919

20-
.. sample:: blockstoragev2/volume_types/create.php
20+
.. sample:: BlockStorage/v2/volume_types/create.php
2121
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_createVolumeType
2222

2323

@@ -27,7 +27,7 @@ Retrieve details of a volume type
2727
When retrieving a volume type, sometimes you only want to operate on it - say to update or delete it. If this is the
2828
case, then there is no need to perform an initial GET request to the API:
2929

30-
.. sample:: blockstoragev2/volume_types/get.php
30+
.. sample:: BlockStorage/v2/volume_types/get.php
3131

3232
If, however, you *do* want to retrieve all the details of a remote volume type from the API, you just call:
3333

@@ -46,7 +46,7 @@ Update a volume type
4646
The first step when updating a volume type is modifying the attributes you want updated. By default, only a volume
4747
type's name can be edited.
4848

49-
.. sample:: blockstoragev2/volume_types/update.php
49+
.. sample:: BlockStorage/v2/volume_types/update.php
5050
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_update
5151

5252

@@ -55,5 +55,5 @@ Delete volume type
5555

5656
To permanently delete a volume type:
5757

58-
.. sample:: blockstoragev2/volume_types/delete.php
58+
.. sample:: BlockStorage/v2/volume_types/delete.php
5959
.. refdoc:: OpenStack/BlockStorage/v2/Models/VolumeType.html#method_delete

doc/services/block-storage/v2/volumes.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Volumes
44
List volumes
55
------------
66

7-
.. sample:: blockstoragev2/volumes/list.php
7+
.. sample:: BlockStorage/v2/volumes/list.php
88
.. refdoc:: OpenStack/BlockStorage/v2/Service.html#method_listVolumes
99

1010
Each iteration will return a php:class:`Volume` instance <OpenStack/BlockStorage/v2/Models/Volume.html>.
@@ -17,15 +17,15 @@ Detailed information
1717
By default, only the ``id``, ``links`` and ``name`` attributes are returned. To return *all* information
1818
for a flavor, you must enable detailed information, like so:
1919

20-
.. sample:: blockstoragev2/volumes/list_detail.php
20+
.. sample:: BlockStorage/v2/volumes/list_detail.php
2121

2222
Create volume
2323
-------------
2424

2525
The only attributes that are required when creating a volume are a size in GiB. The simplest example
2626
would therefore be this:
2727

28-
.. sample:: blockstoragev2/volumes/create.php
28+
.. sample:: BlockStorage/v2/volumes/create.php
2929

3030
You can further configure your new volume, however, by following the below sections, which instruct you how to add
3131
specific functionality.
@@ -35,17 +35,17 @@ specific functionality.
3535
Create from image
3636
~~~~~~~~~~~~~~~~~
3737

38-
.. sample:: blockstoragev2/volumes/create_from_image.php
38+
.. sample:: BlockStorage/v2/volumes/create_from_image.php
3939

4040
Create from snapshot
4141
~~~~~~~~~~~~~~~~~~~~
4242

43-
.. sample:: blockstoragev2/volumes/create_from_snapshot.php
43+
.. sample:: BlockStorage/v2/volumes/create_from_snapshot.php
4444

4545
Create from source volume
4646
~~~~~~~~~~~~~~~~~~~~~~~~~
4747

48-
.. sample:: blockstoragev2/volumes/create_from_source_volume.php
48+
.. sample:: BlockStorage/v2/volumes/create_from_source_volume.php
4949

5050

5151
Retrieve volume details
@@ -54,7 +54,7 @@ Retrieve volume details
5454
When retrieving a volume, sometimes you only want to operate on it - say to update or delete it. If this is the case,
5555
then there is no need to perform an initial GET request to the API:
5656

57-
.. sample:: blockstoragev2/volumes/get.php
57+
.. sample:: BlockStorage/v2/volumes/get.php
5858

5959
If, however, you *do* want to retrieve all the details of a remote volume from the API, you just call:
6060

@@ -73,13 +73,13 @@ Update volume
7373
The first step when updating a volume is modifying the attributes you want updated. By default, only a volume's name
7474
and description can be edited.
7575

76-
.. sample:: blockstoragev2/volumes/update.php
76+
.. sample:: BlockStorage/v2/volumes/update.php
7777
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_update
7878

7979
Delete volume
8080
-------------
8181

8282
To permanently delete a volume:
8383

84-
.. sample:: blockstoragev2/volumes/delete.php
84+
.. sample:: BlockStorage/v2/volumes/delete.php
8585
.. refdoc:: OpenStack/BlockStorage/v2/Models/Volume.html#method_delete

doc/services/compute/v2/flavors.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Flavors
44
List flavors
55
------------
66

7-
.. sample:: compute/v2/flavors/list_flavors.php
7+
.. sample:: Compute/v2/flavors/list_flavors.php
88
.. refdoc:: OpenStack/Compute/v2/Service.html#method_listFlavors
99

1010
Each iteration will return a :php:class:`Flavor` instance <OpenStack/Compute/v2/Models/Flavor.html>.
@@ -26,7 +26,7 @@ for a flavor, you must pass ``true`` as the last parameter, like so:
2626
Retrieve a flavor
2727
-----------------
2828

29-
.. sample:: compute/v2/flavors/get_flavor.php
29+
.. sample:: Compute/v2/flavors/get_flavor.php
3030
.. refdoc:: OpenStack/Compute/v2/Service.html#method_getFlavor
3131

3232
When retrieving a flavor, sometimes you only want to operate on it. If this is the case,

doc/services/compute/v2/images.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Images
44
List images
55
-----------
66

7-
.. sample:: compute/v2/images/list_images.php
7+
.. sample:: Compute/v2/images/list_images.php
88

99
Each iteration will return an :apiref:Image instance <OpenStack/Compute/v2/Models/Image.html>_.
1010

@@ -27,7 +27,7 @@ Retrieve an image
2727
When retrieving an image, sometimes you only want to operate on it - say to update or delete it. If this is the case,
2828
then there is no need to perform an initial GET request to the server:
2929

30-
.. sample:: compute/v2/images/get_image.php
30+
.. sample:: Compute/v2/images/get_image.php
3131
.. refdoc:: OpenStack/Compute/v2/Service.html#method_getImage
3232

3333
If, however, you *do* want to retrieve all the details of a remote image from the API, you just call:
@@ -41,7 +41,7 @@ which will update the state of the local object. This gives you an element of co
4141
Delete an image
4242
---------------
4343

44-
.. sample:: compute/v2/images/delete_image.php
44+
.. sample:: Compute/v2/images/delete_image.php
4545
.. refdoc:: OpenStack/Compute/v2/Models/Image.html#method_delete
4646

4747
Retrieve metadata
@@ -58,7 +58,7 @@ This operation will retrieve the existing metadata for an image:
5858
Reset metadata
5959
--------------
6060

61-
.. sample:: compute/v2/images/reset_image_metadata.php
61+
.. sample:: Compute/v2/images/reset_image_metadata.php
6262

6363
This operation will _replace_ all existing metadata with whatever is provided in the request. Any existing metadata
6464
not specified in the request will be deleted.
@@ -95,5 +95,5 @@ Delete image metadata item
9595

9696
This operation allows you to remove a specific metadata item:
9797

98-
.. sample:: compute/v2/images/delete_image_metadata_item.php
98+
.. sample:: Compute/v2/images/delete_image_metadata_item.php
9999
.. refdoc:: OpenStack/Compute/v2/Models/Image.html#method_deleteMetadataItem

0 commit comments

Comments
 (0)