|
| 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 | + php-version: ["7.4", "8.1"] |
| 17 | + |
| 18 | + services: |
| 19 | + neo4j: |
| 20 | + image: neo4j:3.5 |
| 21 | + env: |
| 22 | + NEO4J_AUTH: neo4j/test |
| 23 | + NEO4JLABS_PLUGINS: '["apoc"]' |
| 24 | + ports: |
| 25 | + - 7687:7687 |
| 26 | + - 7474:7474 |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Checkout driver |
| 30 | + uses: actions/checkout@v2 |
| 31 | + |
| 32 | + - name: Cache Composer dependencies |
| 33 | + uses: actions/cache@v2 |
| 34 | + with: |
| 35 | + path: /tmp/composer-cache |
| 36 | + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} |
| 37 | + |
| 38 | + - uses: php-actions/composer@v6 |
| 39 | + with: |
| 40 | + progress: yes |
| 41 | + php_version: ${{ matrix.php-version }} |
| 42 | + version: 2 |
| 43 | + |
| 44 | + - name: Setup PHP |
| 45 | + uses: shivammathur/setup-php@v2 |
| 46 | + with: |
| 47 | + php-version: ${{ matrix.php-version }} |
| 48 | + |
| 49 | + - name: Checkout TestKit (testing tool) |
| 50 | + uses: actions/checkout@v2 |
| 51 | + with: |
| 52 | + repository: neo4j-drivers/testkit |
| 53 | + path: testkit |
| 54 | + ref: '4.3' |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + run: | |
| 58 | + sudo apt-get update |
| 59 | + # install docker |
| 60 | + sudo apt-get install \ |
| 61 | + apt-transport-https \ |
| 62 | + ca-certificates \ |
| 63 | + curl \ |
| 64 | + gnupg \ |
| 65 | + lsb-release |
| 66 | + # Python (needed for dummy driver and TestKit) |
| 67 | + sudo apt-get install python3 python3-pip |
| 68 | + git clone https://github.com/pyenv/pyenv.git .pyenv |
| 69 | + python -m pip install --upgrade pip |
| 70 | + cd testkit |
| 71 | + python -m pip install -r requirements.txt |
| 72 | +
|
| 73 | + - name: Sleep for 60s |
| 74 | + uses: juliangruber/sleep-action@v1 |
| 75 | + with: |
| 76 | + time: 60s |
| 77 | + |
| 78 | + - name: Run TestKit |
| 79 | + env: |
| 80 | + TEST_NEO4J_HOST: localhost |
| 81 | + TEST_NEO4J_USER: neo4j |
| 82 | + TEST_NEO4J_PASS: test |
| 83 | + TEST_DRIVER_NAME: php |
| 84 | + run: | |
| 85 | + php testkit-backend/index.php & |
| 86 | + cd testkit |
| 87 | + sleep 2 |
| 88 | + python3 -m unittest -v "tests.neo4j.test_authentication.TestAuthenticationBasic" |
0 commit comments