Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: php-opencloud/openstack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.2
Choose a base ref
...
head repository: php-opencloud/openstack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 779 changed files with 27,691 additions and 7,559 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.github export-ignore
/doc export-ignore
/samples export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/.readthedocs.yaml export-ignore
/.scrutinizer.yml export-ignore
/phpunit.sample.xml.dist export-ignore
/phpunit.xml.dist export-ignore
50 changes: 50 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Format"
on:
push:
branches:
- '*'

jobs:
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.2

- run: composer install --no-interaction --no-progress --no-suggest

- run: composer normalize

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Normalize composer.json

php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- uses: shivammathur/setup-php@v2
with:
coverage: none
extensions: mbstring
php-version: 8.1

- run: composer install --no-interaction --no-progress --no-suggest

- run: vendor/bin/php-cs-fixer fix

- run: git pull

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply php-cs-fixer changes
132 changes: 132 additions & 0 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Integration Tests

on:
workflow_dispatch:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip integration')
strategy:
fail-fast: false
matrix:
openstack_version: [ "stable/2023.2" ]
php_version: [ 8.1 ]
include:
- name: "dalmatian"
openstack_version: "stable/2024.2"
ubuntu_version: "22.04"
- name: "caracal"
openstack_version: "stable/2024.1"
ubuntu_version: "22.04"
- name: "bobcat"
openstack_version: "stable/2023.2"
ubuntu_version: "22.04"
- name: "antelope"
openstack_version: "unmaintained/2023.1"
ubuntu_version: "22.04"
- name: "zed"
openstack_version: "unmaintained/zed"
ubuntu_version: "20.04"
- name: "yoga"
openstack_version: "unmaintained/yoga"
ubuntu_version: "20.04"
- name: "wallaby"
openstack_version: "unmaintained/wallaby"
ubuntu_version: "20.04"
block_storage_v2: true
runs-on: ubuntu-${{ matrix.ubuntu_version }}
name: Deploy OpenStack ${{ matrix.name }} and run 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.15
with:
branch: ${{ matrix.openstack_version }}
conf_overrides: |
CINDER_ISCSI_HELPER=lioadm
SWIFT_ENABLE_TEMPURLS=True
SWIFT_TEMPURL_KEY=secretkey
TARGET_BRANCH=${{ matrix.openstack_version }}
[[post-config|\$SWIFT_CONFIG_PROXY_SERVER]]
[filter:versioned_writes]
allow_object_versioning = true
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: Check if Block Storage API v2 must be tested
if: matrix.block_storage_v2 == true
run: echo "OS_BLOCK_STORAGE_V2=1" >> "$GITHUB_ENV"

- name: Execute Integration tests via PhpUnit
run: vendor/bin/phpunit --configuration ./phpunit.sample.xml.dist

- name: Collect logs
if: ${{ failure() }}
run: |
set -x
journalctl >failure-logs
- name: Save logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: failure-logs
path: failure-logs
57 changes: 57 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Unit Tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-22.04
if: |
!contains(github.event.pull_request.body, 'skip ci')
&& !contains(github.event.pull_request.body, 'skip unit')
strategy:
fail-fast: false
matrix:
php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 ]
composer:
- name: lowest
arg: "--prefer-lowest --prefer-stable"
- name: highest
arg: "" # No args added as highest is default
name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.composer.name }} dependencies
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 }}-cache-${{ matrix.php }}-${{ matrix.composer.name }}-${{ hashFiles('**.composer.lock') }}

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl
tools: composer:v2
coverage: none

- run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer.arg }}

- run: vendor/bin/parallel-lint --exclude vendor .

- name: execute unit tests
run: vendor/bin/phpunit --configuration phpunit.xml.dist

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
.test/
coverage/
vendor/

*.pyc

phpunit.xml
.phpunit.result.cache
coverage.xml
composer.lock
env_test.sh
23 changes: 23 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

if (!file_exists(__DIR__.'/src')) {
exit(0);
}

return (new PhpCsFixer\Config())
->setRules(
[
'@PSR2' => true,
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['default' => 'align'],
'protected_to_private' => false,
]
)
->setUsingCache(false)
->setRiskyAllowed(true)
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->append([__FILE__, __DIR__.'/samples'])
);
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements.txt
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

Loading