|
| 1 | +name: Testkit Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ '**' ] |
| 6 | + pull_request: |
| 7 | + branches: ['**'] |
| 8 | + |
| 9 | +jobs: |
| 10 | + tests: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + name: "Running Testkit tests for PHP ${{matrix.php-version}} on Neo4j and testkit ${{ matrix.neo4j-version }} with simple config" |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + neo4j-version: ["3.5", "4.0", "4.1", "4.2", "4.3"] |
| 17 | + php-version: ["7.4", "8.0", "8.1"] |
| 18 | + |
| 19 | + services: |
| 20 | + neo4j: |
| 21 | + image: neo4j:${{ matrix.neo4j-version }} |
| 22 | + env: |
| 23 | + NEO4J_AUTH: neo4j/test |
| 24 | + NEO4JLABS_PLUGINS: '["apoc"]' |
| 25 | + ports: |
| 26 | + - 7687:7687 |
| 27 | + - 7474:7474 |
| 28 | + options: >- |
| 29 | + --health-cmd "wget http://localhost:7474 || exit 1" |
| 30 | +
|
| 31 | + steps: |
| 32 | + - name: Checkout driver |
| 33 | + uses: actions/checkout@v2 |
| 34 | + |
| 35 | + - uses: php-actions/composer@v6 |
| 36 | + with: |
| 37 | + progress: yes |
| 38 | + php_version: ${{ matrix.php-version }} |
| 39 | + version: 2 |
| 40 | + |
| 41 | + - name: Setup PHP |
| 42 | + uses: shivammathur/setup-php@v2 |
| 43 | + with: |
| 44 | + php-version: ${{ matrix.php-version }} |
| 45 | + |
| 46 | + - name: Checkout TestKit (testing tool) |
| 47 | + uses: actions/checkout@v2 |
| 48 | + with: |
| 49 | + repository: neo4j-drivers/testkit |
| 50 | + path: testkit |
| 51 | + ref: '4.3' |
| 52 | + |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + sudo apt-get update |
| 56 | + # install docker |
| 57 | + sudo apt-get install \ |
| 58 | + apt-transport-https \ |
| 59 | + ca-certificates \ |
| 60 | + curl \ |
| 61 | + gnupg \ |
| 62 | + lsb-release |
| 63 | + # Python (needed for dummy driver and TestKit) |
| 64 | + sudo apt-get install python3 python3-pip |
| 65 | + git clone https://github.com/pyenv/pyenv.git .pyenv |
| 66 | + python -m pip install --upgrade pip |
| 67 | + cd testkit |
| 68 | + python -m pip install -r requirements.txt |
| 69 | +
|
| 70 | + - name: Run TestKit |
| 71 | + env: |
| 72 | + TEST_NEO4J_HOST: localhost |
| 73 | + TEST_NEO4J_USER: neo4j |
| 74 | + TEST_NEO4J_PASS: test |
| 75 | + TEST_DRIVER_NAME: php |
| 76 | + run: | |
| 77 | + php testkit-backend/index.php & |
| 78 | + cd testkit |
| 79 | + sleep 2 |
| 80 | + python3 -m unittest -v "tests.neo4j.test_authentication.TestAuthenticationBasic" |
0 commit comments