|
| 1 | +name: Phpfastcache Tests |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + run: |
| 5 | + runs-on: ${{ matrix.operating-system }} |
| 6 | + timeout-minutes: 60 |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + operating-system: [ubuntu-latest] |
| 10 | + php-versions: ['8.0', '8.1', '8.2', '8.3'] |
| 11 | + name: PHP ${{ matrix.php-versions }} quality/tests on ${{ matrix.operating-system }} |
| 12 | + env: |
| 13 | + extensions: mbstring, intl, pdo_sqlite, json, redis, grpc, couchbase-3.2.2 |
| 14 | + key: cache-v1 |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - name: Install Couchbase Server |
| 20 | + run: ./bin/ci/scripts/install_couchbase.sh |
| 21 | + |
| 22 | + - name: Setup cache environment |
| 23 | + id: extcache |
| 24 | + uses: shivammathur/cache-extensions@v1 |
| 25 | + with: |
| 26 | + php-version: ${{ matrix.php-versions }} |
| 27 | + extensions: ${{ env.extensions }} |
| 28 | + key: ${{ env.key }} |
| 29 | + |
| 30 | + - name: Cache extensions |
| 31 | + uses: actions/cache@v3 |
| 32 | + with: |
| 33 | + path: ${{ steps.extcache.outputs.dir }} |
| 34 | + key: ${{ steps.extcache.outputs.key }} |
| 35 | + restore-keys: ${{ steps.extcache.outputs.key }} |
| 36 | + |
| 37 | + - name: Setup PHP |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + coverage: none |
| 41 | + php-version: ${{ matrix.php-versions }} |
| 42 | + extensions: ${{ env.extensions }} |
| 43 | + ini-values: apc.enabled=1, apc.shm_size=32M, apc.ttl=7200, apc.enable_cli=1, apc.serializer=php |
| 44 | + |
| 45 | + - name: Setup Memcached server |
| 46 | + uses: niden/actions-memcached@v7 |
| 47 | + |
| 48 | + - name: Setup Redis server |
| 49 | + uses: zhulik/redis-action@v1.0.0 |
| 50 | + with: |
| 51 | + redis version: '5' |
| 52 | + |
| 53 | + - name: Validate composer.json and composer.lock |
| 54 | + run: composer validate --strict |
| 55 | + |
| 56 | + - name: Cache Composer packages |
| 57 | + id: composer-cache |
| 58 | + uses: actions/cache@v3 |
| 59 | + with: |
| 60 | + path: vendor |
| 61 | + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 62 | + restore-keys: | |
| 63 | + ${{ runner.os }}-php- |
| 64 | + |
| 65 | + - name: Setup GCP environment |
| 66 | + run: "./bin/ci/scripts/setup_gcp.sh || echo \"GCP setup failed (maybe due to fork limitation)\"" |
| 67 | + env: |
| 68 | + BASE64_GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.BASE64_GOOGLE_APPLICATION_CREDENTIALS }} |
| 69 | + GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} |
| 70 | + |
| 71 | + - name: Install dependencies |
| 72 | + run: ./bin/ci/scripts/install_dependencies.sh |
| 73 | + |
| 74 | + - name: Run quality tools |
| 75 | + run: composer run-script quality |
| 76 | + |
| 77 | + - name: Run tests |
| 78 | + env: |
| 79 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 80 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 81 | + GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} |
| 82 | + GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }} |
| 83 | + run: composer run-script tests |
0 commit comments