Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add windows-latest as it supports docker #3232

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 38 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Start PostgreSQL
- name: Start PostgreSQL Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: docker/postgres-server
run: docker-compose up -d && docker-compose logs
- name: Start PostgreSQL Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: wsl-bash {0}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we extract shell parameter to the matrix, so we use the same step without adding extra if?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it spawn Windows-based PostgreSQL or Linux-based one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's interesting. So this would be testing some JDK running on Windows vs a Linux Postgres running in Docker?

If we're going to test against Windows (i.e. duplicate what's in AppVeyor), could have a separate branch for the server itself running on Windows. The GitHub Runner installed software list for "windows-2022" says that it already has PostgreSQL 14.x installed: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#databases

I think we'd be kind of tied to whatever they include in the runner image, but that's not any worse than what we have in AppVeyor. With the advantage that it'd work for forks too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it spawn Windows-based PostgreSQL or Linux-based one?

Well the reason I did this was because there are no windows postgresql docker images, hence running on ubuntu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that's interesting. So this would be testing some JDK running on Windows vs a Linux Postgres running in Docker?

If we're going to test against Windows (i.e. duplicate what's in AppVeyor), could have a separate branch for the server itself running on Windows. The GitHub Runner installed software list for "windows-2022" says that it already has PostgreSQL 14.x installed: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#databases

I think we'd be kind of tied to whatever they include in the runner image, but that's not any worse than what we have in AppVeyor. With the advantage that it'd work for forks too.

Yeah, well ideally we want to be able to test windows with different PostgreSQL versions. If we just want v14 then we can use whatever is there

working-directory: docker/postgres-server
run: docker-compose up -d && docker-compose logs

- name: 'Set up JDK 17'
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -153,7 +160,27 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Start PostgreSQL PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }}
- name: Start PostgreSQL Ubuntu PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }}
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: docker/postgres-server
env:
PGV: ${{ matrix.pg_version }}
TZ: ${{ matrix.server_tz }}
XA: ${{ matrix.xa }}
SSL: ${{ matrix.ssl }}
SCRAM: ${{ matrix.scram }}
CREATE_REPLICAS: ${{ matrix.replication }}
# The below run command is long, however, it is intentional, and it makes the output nicer in GitHub UI
run: |
echo 'Starting PostgreSQL via docker-compose down; PGV=${{ matrix.pg_version }} TZ=${{ matrix.server_tz }} XA=${{ matrix.xa }} SSL=${{ matrix.ssl }} SCRAM=${{ matrix.scram }} CREATE_REPLICAS=${{ matrix.replication }} docker-compose up'
docker-compose down -v --rmi local || true
sed -i -r '/- (543[3-4]):\1/d' docker-compose.yml
docker-compose up -d
docker-compose logs
- name: Start PostgreSQL Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: Vampire/setup-wsl@v3
shell: wsl-bash {0}
working-directory: docker/postgres-server
env:
PGV: ${{ matrix.pg_version }}
Expand All @@ -170,6 +197,7 @@ jobs:
sed -i -r '/- (543[3-4]):\1/d' docker-compose.yml
docker-compose up -d
docker-compose logs

- name: Set up Java 17 and ${{ matrix.non_ea_java_version }}, ${{ matrix.java_distribution }}, ${{ runner.arch }}
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -199,7 +227,14 @@ jobs:
distribution: ${{ matrix.java_distribution }}
# Architecture is explicit to workaround https://github.com/actions/setup-java/issues/559
architecture: ${{ runner.arch == 'ARM64' && 'aarch64' || 'x64' }}
- name: Prepare local properties
- name: Prepare local properties windows
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
run: |
echo "enable_ssl_tests=${{ matrix.ssl == 'yes' && 'true' || 'false' }}" | Out-File .\ssltest.local.properties
echo "preferQueryMode=${{ matrix.query_mode }}" | Out-File .\build.local.properties
- name: Prepare local properties ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# See https://github.com/actions/runner/issues/409
cat <<EOF >ssltest.local.properties
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ matrix.addAxis({
title: x => x.replace('-latest', ''),
values: [
'ubuntu-latest',
'windows-latest',
// We use docker-compose for launching PostgreSQL
// 'windows-latest',
// 'macos-latest',
]
});
Expand Down