Skip to content

Commit

Permalink
Merge pull request #1 from hidakatsuya/allow-version-of-postgres-to-b…
Browse files Browse the repository at this point in the history
…e-specified

Allow postgres version to be specified
  • Loading branch information
hidakatsuya authored May 16, 2024
2 parents e142dfb + 382a1a0 commit fbeb7f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
build:
runs-on: ubuntu-latest

name: ${{ matrix.redmine-repository }} ${{ matrix.redmine-version }} ${{ matrix.redmine-database }}

strategy:
matrix:
include:
Expand All @@ -28,7 +30,7 @@ jobs:

- redmine-repository: 'redmica/redmica'
redmine-version: 'stable-2.4'
redmine-database: 'postgresql'
redmine-database: 'postgres:14'
ruby-version: '3.2'
expected-about-db-adapter: 'PostgreSQL'
expected-about-redmine-version: '2\.4\.[0-9]\.stable'
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ This action installs Redmine and sets up an environment to run tests. It is prim
# The branch, tag or commit to checkout. Default is master.
version: 'master'

# Database to use for testing. Available values are sqlite3, postgresql. Default is sqlite3.
# Database to use for testing. Available values are sqlite3 or
# an official PostgreSQL image tag such as postgres:14. Default is sqlite3.
database: 'sqlite3'

# Ruby version to use for testing. See ruby/setup-ruby's ruby-version input for available versions.
Expand All @@ -36,7 +37,7 @@ See also [action.yml](./action.yml).
with:
repository: 'redmica/redmica'
version: 'v2.4.2'
database: 'postgresql'
database: 'postgres:14'
ruby-version: '3.2'
```
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
required: true
default: 'master'
database:
description: 'Database to use for testing. Available values are sqlite3, postgresql. Default is sqlite3.'
description: 'Database to use for testing. Available values are sqlite3 or an official PostgreSQL image tag such as postgres:14. Default is sqlite3.'
required: true
default: 'sqlite3'
ruby-version:
Expand Down Expand Up @@ -73,15 +73,15 @@ runs:
shell: bash

- name: Set up PostgreSQL database connection for testing
if: ${{ inputs.database == 'postgresql' }}
if: ${{ startsWith(inputs.database, 'postgres:') }}
run: |
sudo apt-get install -y --no-install-recommends libpq-dev
docker run \
--name redmine-postgres \
-e POSTGRES_PASSWORD=postgres \
-p 5432:5432 \
-d postgres:14
-d ${{ inputs.database }}
cat <<EOS > config/database.yml
test:
Expand Down

0 comments on commit fbeb7f8

Please sign in to comment.