Skip to content

build: Better way to pick up version in native-image tests #1163

build: Better way to pick up version in native-image tests

build: Better way to pick up version in native-image tests #1163

Workflow file for this run

name: Validate and test
on:
pull_request:
push:
branches:
- main
tags-ignore: [ v.* ]
permissions:
contents: read
jobs:
check-code-style:
name: Checks
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
uses: coursier/[email protected]
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Code style check, compilation and binary-compatibility check
run: |-
cp .jvmopts-ci .jvmopts
sbt scalafmtCheckAll scalafmtSbtCheck headerCheck mimaReportBinaryIssues +Test/compile
test-postgres:
name: Run test with Postgres
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Start DB
run: |-
docker compose -f docker/docker-compose-postgres.yml up --wait
docker exec -i postgres-db psql -U postgres -t < ddl-scripts/create_tables_postgres.sql
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt test
test-postgres-jsonb:
name: Run test with Postgres and JSONB payload
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Start DB
run: |-
docker compose -f docker/docker-compose-postgres.yml up --wait
docker exec -i postgres-db psql -U postgres -t < ddl-scripts/create_tables_postgres_jsonb.sql
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dakka.persistence.r2dbc.journal.payload-column-type=JSONB \
-Dakka.persistence.r2dbc.snapshot.payload-column-type=JSONB \
-Dakka.persistence.r2dbc.state.payload-column-type=JSONB \
"core/testOnly akka.persistence.r2dbc.PayloadSpec"
test-postgres-data-partitions:
name: Run test with Postgres and several data partitions
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Start DB
run: |-
docker compose -f docker/docker-compose-postgres-2.yml up --wait
docker exec -i postgres-db-0 psql -U postgres -t < ddl-scripts/create_tables_postgres_0-1.sql
docker exec -i postgres-db-1 psql -U postgres -t < ddl-scripts/create_tables_postgres_2-3.sql
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dconfig.resource=application-postgres-data-partitions.conf test
test-yugabyte:
name: Run tests with Yugabyte
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Start DB
run: |-
docker-compose -f docker/docker-compose-yugabyte.yml up -d
# TODO: could we poll the port instead of sleep?
sleep 10
docker exec -i yb-tserver-n1 /home/yugabyte/bin/ysqlsh -h yb-tserver-n1 -t < ddl-scripts/create_tables_yugabyte.sql
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dconfig.resource=application-yugabyte.conf test
test-h2:
name: Run test with H2
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dconfig.resource=application-h2.conf test
test-sqlserver:
name: Run test with SQL Server
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Start DB
run: |-
docker compose -f docker/docker-compose-sqlserver.yml up --wait
docker exec -i sqlserver-db /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '<YourStrong@Passw0rd>' -d master < ddl-scripts/create_tables_sqlserver.sql
- name: sbt test
run: |-
cp .jvmopts-ci .jvmopts
sbt -Dconfig.resource=application-sqlserver.conf test
test-docs:
name: Docs
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-persistence-r2dbc'
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Cache Coursier cache
# https://github.com/coursier/cache-action/releases
# v6.4.4
uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7
- name: Set up JDK 11
# https://github.com/coursier/setup-action/releases
# v1.3.4
uses: coursier/setup-action@48280172a2c999022e42527711d6b28e4945e6f0
with:
jvm: temurin:1.11.0
- name: Run Paradox
run: |-
cp .jvmopts-ci .jvmopts
sbt docs/paradox