Skip to content

Test

Test #769

Workflow file for this run

name: Test
on:
push:
paths:
- '.github/workflows/test.yml'
pull_request:
paths:
- '.github/workflows/test.yml'
schedule:
- cron: |
0 0 * * *
workflow_dispatch:
concurrency:
group: test
cancel-in-progress: true
jobs:
run:
name: ${{ matrix.id }}
if: |
!startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
id:
- "alpine-17"
- "alpine-16"
- "alpine-15"
- "alpine-14"
- "alpine-13"
- "alpine-12"
- "alpine-17-slim"
- "alpine-16-slim"
- "alpine-15-slim"
- "alpine-14-slim"
- "alpine-13-slim"
- "alpine-12-slim"
- "debian-17"
- "debian-16"
- "debian-15"
- "debian-14"
- "debian-13"
- "debian-12"
steps:
- name: Install dependencies
run: |
sudo apt -u -V install \
curl \
jq \
postgresql-client
- name: Detect the latest release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
curl \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer ${GH_TOKEN}" \
--fail-with-body \
https://api.github.com/repos/pgroonga/pgroonga/releases/latest | \
tee releases.json
latest_version=$(jq -r .tag_name releases.json)
echo "LATEST_VERSION=${latest_version}" >> ${GITHUB_ENV}
- name: Check PGroonga version
env:
PGPASSWORD: pgroonga
run: |
tag="${LATEST_VERSION}-${{ matrix.id }}"
docker_image="groonga/pgroonga:${tag}"
docker run \
-d \
-e POSTGRES_DB=pgroonga \
-e POSTGRES_PASSWORD=${PGPASSWORD} \
-e POSTGRES_USER=pgroonga \
-p 127.0.0.1:5432:5432 \
${docker_image}
for i in {1..60}; do
if pg_isready -h 127.0.0.1; then
break
fi
sleep 1
done
if [ $i -eq 60 ]; then
echo "PostgreSQL isn't available"
exit 1
fi
psql \
-h 127.0.0.1 \
-U pgroonga \
-c "CREATE EXTENSION pgroonga;"
pgroonga_version=$( \
psql \
-h 127.0.0.1 \
-U pgroonga \
-t \
-A \
-c "SELECT extversion FROM pg_catalog.pg_extension WHERE extname = 'pgroonga';" \
)
set -x
[ "${LATEST_VERSION}" = "${pgroonga_version}" ]