|
| 1 | +# Run the build using the latest ORM 5.x snapshots |
| 2 | +# so that we can spot integration issues early |
| 3 | +name: Latest Vert.x SQL client 4 |
| 4 | + |
| 5 | +on: |
| 6 | + # Trigger the workflow on push or pull request, |
| 7 | + # but only for the main branch |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - main |
| 14 | + schedule: |
| 15 | + # * is a special character in YAML, so you have to quote this string |
| 16 | + # Run every hour at minute 25 |
| 17 | + - cron: '25 * * * *' |
| 18 | + |
| 19 | +# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting. |
| 20 | +concurrency: |
| 21 | + # Consider that two builds are in the same concurrency group (cannot run concurrently) |
| 22 | + # if they use the same workflow and are about the same branch ("ref") or pull request. |
| 23 | + group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" |
| 24 | + # Cancel previous builds in the same concurrency group even if they are in process |
| 25 | + # for pull requests or pushes to forks (not the upstream repository). |
| 26 | + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-reactive' }} |
| 27 | + |
| 28 | +jobs: |
| 29 | + # The examples test the Hibernate ORM Gradle plugin. We use it for bytecode enhancements. |
| 30 | + run_examples: |
| 31 | + name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }} with latest Vert.x ${{ matrix.orm-version }} |
| 32 | + runs-on: ubuntu-latest |
| 33 | + strategy: |
| 34 | + matrix: |
| 35 | + example: [ 'session-example', 'native-sql-example' ] |
| 36 | + vertx-version: [ '[4.4,4.5)' ] |
| 37 | + db: ['MySQL', 'PostgreSQL'] |
| 38 | + exclude: |
| 39 | + # 'native-sql-example' doesn't run on MySQL because it has native queries |
| 40 | + - example: 'native-sql-example' |
| 41 | + db: 'MySQL' |
| 42 | + services: |
| 43 | + # Label used to access the service container |
| 44 | + mysql: |
| 45 | + # Docker Hub image |
| 46 | + image: mysql:8.0.33 |
| 47 | + env: |
| 48 | + MYSQL_ROOT_PASSWORD: hreact |
| 49 | + MYSQL_DATABASE: hreact |
| 50 | + MYSQL_USER: hreact |
| 51 | + MYSQL_PASSWORD: hreact |
| 52 | + # Set health checks to wait until mysql has started |
| 53 | + options: >- |
| 54 | + --health-cmd="mysqladmin ping" |
| 55 | + --health-interval 10s |
| 56 | + --health-timeout 5s |
| 57 | + --health-retries 5 |
| 58 | + ports: |
| 59 | + - 3306:3306 |
| 60 | + postgres: |
| 61 | + # Docker Hub image |
| 62 | + image: postgres:15.2 |
| 63 | + env: |
| 64 | + POSTGRES_DB: hreact |
| 65 | + POSTGRES_USER: hreact |
| 66 | + POSTGRES_PASSWORD: hreact |
| 67 | + # Set health checks to wait until postgres has started |
| 68 | + options: >- |
| 69 | + --health-cmd pg_isready |
| 70 | + --health-interval 10s |
| 71 | + --health-timeout 5s |
| 72 | + --health-retries 5 |
| 73 | + ports: |
| 74 | + - 5432:5432 |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v2 |
| 77 | + - name: Set up JDK 11 |
| 78 | + with: |
| 79 | + java-version: 11 |
| 80 | + uses: actions/setup-java@v1 |
| 81 | + - name: Print the effective ORM version used |
| 82 | + run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency io.vertx:vertx-sql-client -PvertxVersion='${{ matrix.vertx-version }}' -PenableSonatypeOpenSourceSnapshotsRep |
| 83 | + - name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }} |
| 84 | + run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }} -PvertxVersion='${{ matrix.vertx-version }}' -PenableSonatypeOpenSourceSnapshotsRep |
| 85 | + |
| 86 | + test_dbs: |
| 87 | + name: Test with ${{ matrix.db }} and Vert.x ${{ matrix.vertx-version }} |
| 88 | + runs-on: ubuntu-latest |
| 89 | + strategy: |
| 90 | + matrix: |
| 91 | + vertx-version: [ '[4.4,4.5)' ] |
| 92 | + db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'DB2', 'CockroachDB', 'MSSQLServer', 'Oracle' ] |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v2 |
| 95 | + - name: Set up JDK 11 |
| 96 | + uses: actions/setup-java@v1 |
| 97 | + with: |
| 98 | + java-version: 11 |
| 99 | + - name: Print the effective ORM version used |
| 100 | + run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency io.vertx:vertx-sql-client -PvertxVersion='${{ matrix.vertx-version }}' -PenableSonatypeOpenSourceSnapshotsRep |
| 101 | + - name: Build and Test with ${{ matrix.db }} |
| 102 | + run: ./gradlew build -Pdb=${{ matrix.db }} -Pdocker -PvertxVersion='${{ matrix.vertx-version }}' -PenableSonatypeOpenSourceSnapshotsRep -PshowStandardOutput |
| 103 | + |
0 commit comments