|
| 1 | +name: Unit and Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ '**' ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + tests: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + php-version: ['8'] |
| 14 | + neo4j-version: ["4.2"] |
| 15 | + name: "Create Test Coverage Report" |
| 16 | + |
| 17 | + container: |
| 18 | + image: php:${{ matrix.php-version }}-cli |
| 19 | + |
| 20 | + services: |
| 21 | + neo4j: |
| 22 | + image: neo4j:${{ matrix.neo4j-version }} |
| 23 | + ports: |
| 24 | + - 7474:7474 |
| 25 | + - 7687:7687 |
| 26 | + env: |
| 27 | + NEO4J_AUTH: neo4j/test |
| 28 | + |
| 29 | + core1: |
| 30 | + image: neo4j:${{ matrix.neo4j-version }}-enterprise |
| 31 | + ports: |
| 32 | + - 7686:7686 |
| 33 | + - 5000 |
| 34 | + - 6000 |
| 35 | + - 7000 |
| 36 | + env: |
| 37 | + NEO4J_ACCEPT_LICENSE_AGREEMENT: yes |
| 38 | + NEO4J_AUTH: neo4j/test |
| 39 | + NEO4J_dbms_mode: CORE |
| 40 | + NEO4J_causalClustering_discoveryAdvertisedAddress: core1:5000 |
| 41 | + NEO4J_causalClustering_transactionAdvertisedAddress: core1:6000 |
| 42 | + NEO4J_causalClustering_raftAdvertisedAddress: core1:7000 |
| 43 | + NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000 |
| 44 | + NEO4J_causal__clustering_disable__middleware__logging: false |
| 45 | + NEO4J_dbms_connectors_default__advertised__address: core1 |
| 46 | + |
| 47 | + core2: |
| 48 | + image: neo4j:${{ matrix.neo4j-version }}-enterprise |
| 49 | + ports: |
| 50 | + - 7686 |
| 51 | + - 5000 |
| 52 | + - 6000 |
| 53 | + - 7000 |
| 54 | + env: |
| 55 | + NEO4J_ACCEPT_LICENSE_AGREEMENT: yes |
| 56 | + NEO4J_AUTH: neo4j/test |
| 57 | + NEO4J_dbms_mode: CORE |
| 58 | + NEO4J_causalClustering_discoveryAdvertisedAddress: core2:5000 |
| 59 | + NEO4J_causalClustering_transactionAdvertisedAddress: core2:6000 |
| 60 | + NEO4J_causalClustering_raftAdvertisedAddress: core2:7000 |
| 61 | + NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000 |
| 62 | + NEO4J_dbms_connectors_default__advertised__address: core2 |
| 63 | + |
| 64 | + core3: |
| 65 | + image: neo4j:${{ matrix.neo4j-version }}-enterprise |
| 66 | + ports: |
| 67 | + - 7686 |
| 68 | + - 5000 |
| 69 | + - 6000 |
| 70 | + - 7000 |
| 71 | + env: |
| 72 | + NEO4J_ACCEPT_LICENSE_AGREEMENT: yes |
| 73 | + NEO4J_AUTH: neo4j/test |
| 74 | + NEO4J_dbms_mode: CORE |
| 75 | + NEO4J_causalClustering_discoveryAdvertisedAddress: core3:5000 |
| 76 | + NEO4J_causalClustering_transactionAdvertisedAddress: core3:6000 |
| 77 | + NEO4J_causalClustering_raftAdvertisedAddress: core3:7000 |
| 78 | + NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000 |
| 79 | + NEO4J_dbms_connectors_default__advertised__address: core3 |
| 80 | + |
| 81 | + readreplica1: |
| 82 | + image: neo4j:${{ matrix.neo4j-version }}-enterprise |
| 83 | + ports: |
| 84 | + - 7686 |
| 85 | + - 5000 |
| 86 | + - 6000 |
| 87 | + - 7000 |
| 88 | + env: |
| 89 | + NEO4J_ACCEPT_LICENSE_AGREEMENT: yes |
| 90 | + NEO4J_AUTH: neo4j/test |
| 91 | + NEO4J_dbms_mode: READ_REPLICA |
| 92 | + NEO4J_causalClustering_discoveryAdvertisedAddress: readreplica1:5000 |
| 93 | + NEO4J_causalClustering_transactionAdvertisedAddress: readreplica1:6000 |
| 94 | + NEO4J_causalClustering_raftAdvertisedAddress: readreplica1:7000 |
| 95 | + NEO4J_causalClustering_initialDiscoveryMembers: core1:5000,core2:5000,core3:5000 |
| 96 | + NEO4J_dbms_connectors_default__advertised__address: readreplica1 |
| 97 | + |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v1 |
| 100 | + - name: Setup PHP |
| 101 | + run: | |
| 102 | + apt-get update && apt-get install -y \ |
| 103 | + libfreetype6-dev \ |
| 104 | + libjpeg62-turbo-dev \ |
| 105 | + libmcrypt-dev \ |
| 106 | + libpng-dev \ |
| 107 | + libzip-dev \ |
| 108 | + zip \ |
| 109 | + unzip \ |
| 110 | + wget \ |
| 111 | + git \ |
| 112 | + && docker-php-ext-install -j$(nproc) gd sockets bcmath \ |
| 113 | + && pecl install ds xdebug \ |
| 114 | + && docker-php-ext-enable ds xdebug |
| 115 | + - name: Install Composer |
| 116 | + run: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
| 117 | + - name: Install dependencies |
| 118 | + run: /usr/local/bin/composer install |
| 119 | + - name: Install Code Climate Test Reporter |
| 120 | + run: | |
| 121 | + wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 \ |
| 122 | + && mv test-reporter-latest-linux-amd64 /usr/bin/cc-test-reporter \ |
| 123 | + && chmod +x /usr/bin/cc-test-reporter |
| 124 | + - name: Run PHPUnit Coverage |
| 125 | + run: | |
| 126 | + cc-test-reporter before-build \ |
| 127 | + && XDEBUG_MODE=coverage vendor/bin/phpunit --config phpunit.coverage.xml.dist -d memory_limit=1024M \ |
| 128 | + && mkdir -p out/phpunit \ |
| 129 | + && cp out/phpunit/clover.xml clover.xml |
| 130 | + - name: Run Code Climate Test Reporter |
| 131 | + run: | |
| 132 | + cc-test-reporter after-build --id ec331dd009edca126a4c27f4921c129de840c8a117643348e3b75ec547661f28 --exit-code 0 |
| 133 | +
|
0 commit comments