|
| 1 | +name: Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + tests: |
| 16 | + if: | |
| 17 | + !contains(github.event.pull_request.body, 'skip ci') |
| 18 | + && !contains(github.event.pull_request.body, 'skip integration') |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + openstack_version: [ "stable/wallaby", "stable/zed", "stable/2023.2" ] |
| 23 | + php_version: [ 8.1 ] |
| 24 | + include: |
| 25 | + - name: "bobcat" |
| 26 | + openstack_version: "stable/2023.2" |
| 27 | + ubuntu_version: "22.04" |
| 28 | + - name: "antelope" |
| 29 | + openstack_version: "stable/2023.1" |
| 30 | + ubuntu_version: "22.04" |
| 31 | + - name: "zed" |
| 32 | + openstack_version: "stable/zed" |
| 33 | + ubuntu_version: "20.04" |
| 34 | + - name: "yoga" |
| 35 | + openstack_version: "stable/yoga" |
| 36 | + ubuntu_version: "20.04" |
| 37 | + - name: "wallaby" |
| 38 | + openstack_version: "stable/wallaby" |
| 39 | + ubuntu_version: "20.04" |
| 40 | + block_storage_v2: true |
| 41 | + runs-on: ubuntu-${{ matrix.ubuntu_version }} |
| 42 | + name: Deploy OpenStack ${{ matrix.name }} and run integration tests with php ${{matrix.php_version}} |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v2 |
| 45 | + - name: get cache directory |
| 46 | + id: composer-cache |
| 47 | + run: | |
| 48 | + echo "::set-output name=dir::$(composer config cache-files-dir)" |
| 49 | + - uses: actions/cache@v3 |
| 50 | + with: |
| 51 | + path: | |
| 52 | + ~/.php_cs.cache |
| 53 | + ${{ steps.composer-cache.outputs.dir }} |
| 54 | + key: ${{ runner.os }}-composer-${{ matrix.php_version }}-${{ hashFiles('**.composer.lock') }} |
| 55 | + restore-keys: | |
| 56 | + ${{ runner.os }}-composer-${{ matrix.php_version }}- |
| 57 | + - uses: shivammathur/setup-php@v2 |
| 58 | + with: |
| 59 | + php-version: ${{ matrix.php_version }} |
| 60 | + extensions: curl |
| 61 | + tools: composer:v2 |
| 62 | + coverage: none |
| 63 | + - run: composer install --prefer-dist --no-interaction --no-progress |
| 64 | + - name: Restore devstack cache |
| 65 | + uses: actions/cache@v3 |
| 66 | + with: |
| 67 | + path: | |
| 68 | + /opt/stack/* |
| 69 | + !/opt/stack/data |
| 70 | + ~/devstack/ |
| 71 | + key: ${{ runner.os }}-openstack-${{ matrix.openstack_version }}-${{ github.workflow }} |
| 72 | + - name: Deploy devstack |
| 73 | + |
| 74 | + with: |
| 75 | + branch: ${{ matrix.openstack_version }} |
| 76 | + conf_overrides: | |
| 77 | + CINDER_ISCSI_HELPER=lioadm |
| 78 | + SWIFT_ENABLE_TEMPURLS=True |
| 79 | + SWIFT_TEMPURL_KEY=secretkey |
| 80 | + [[post-config|\$SWIFT_CONFIG_PROXY_SERVER]] |
| 81 | + [filter:versioned_writes] |
| 82 | + allow_object_versioning = true |
| 83 | + enabled_services: 's-account,s-container,s-object,s-proxy,s-bak' |
| 84 | + - name: Set env variables |
| 85 | + run: | |
| 86 | + { |
| 87 | + echo OS_AUTH_URL="$(grep -oP -m 1 "(?<=auth_url: )(.*)\$" /etc/openstack/clouds.yaml)/v3" |
| 88 | + echo OS_REGION=RegionOne |
| 89 | + echo OS_REGION_NAME=RegionOne |
| 90 | + echo OS_USER_ID=$(openstack --os-cloud=devstack-admin user show admin -f value -c id) |
| 91 | + echo OS_USERNAME=admin |
| 92 | + echo OS_PASSWORD=secret |
| 93 | + echo OS_PROJECT_ID=$(openstack --os-cloud=devstack-admin project show admin -f value -c id) |
| 94 | + echo OS_PROJECT_NAME=admin |
| 95 | + echo OS_RESIZE_FLAVOR=c1 |
| 96 | + echo OS_FLAVOR=1 |
| 97 | + echo OS_DOMAIN_ID=default |
| 98 | + } >> "$GITHUB_ENV" |
| 99 | + - name: Execute Block Storage v2 tests |
| 100 | + if: matrix.block_storage_v2 == true |
| 101 | + run: php ./tests/integration/run.php -s=BlockStorage -v=v2 |
| 102 | + - name: Execute Block Storage v3 tests |
| 103 | + run: php ./tests/integration/run.php -s=BlockStorage -v=v3 |
| 104 | + - name: Execute Compute tests |
| 105 | + run: php ./tests/integration/run.php -s=Compute |
| 106 | + - name: Execute Identity tests |
| 107 | + run: php ./tests/integration/run.php -s=Identity |
| 108 | + - name: Execute Images tests |
| 109 | + run: php ./tests/integration/run.php -s=Images |
| 110 | + - name: Execute Networking tests |
| 111 | + run: php ./tests/integration/run.php -s=Networking |
| 112 | + - name: Execute Object Storage tests |
| 113 | + run: php ./tests/integration/run.php -s=ObjectStore |
| 114 | + |
0 commit comments