Skip to content

fix-doi-issues

fix-doi-issues #28

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: test
on:
push:
branches: [ "main", "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
dockerfile: [Dockerfile, Dockerfile.alpine]
permissions:
contents: read # for actions/checkout to fetch code
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build an image from ${{ matrix.dockerfile }}
run: |
docker build -f ${{ matrix.dockerfile }} -t liquibase/liquibase:${{ github.sha }} .
- name: Start H2 test instance
run: |
docker run --name liquibase -d -v $(pwd)/.github/test:/liquibase/changelog liquibase/liquibase:${{ github.sha }} init start-h2
sleep 5
CONTAINER_NAME="liquibase"
LOG_STRING="jdbc:h2:tcp://localhost:9090/mem:dev"
# Check if the container is running
if docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME" 2>/dev/null | grep -q "true"; then
# Get the logs and check if the desired string is present
if docker logs "$CONTAINER_NAME" 2>&1 | grep -q "$LOG_STRING"; then
echo "The log contains the string: $LOG_STRING"
else
echo "The log does not contain the string: $LOG_STRING"
exit 1
fi
else
echo "Error: Container $CONTAINER_NAME is not running."
exit 2
fi
- name: Run Liquibase version
run: |
docker exec liquibase liquibase --version
docker logs liquibase
- name: Run Liquibase update
run: |
docker exec liquibase liquibase update --defaultsFile=/liquibase/changelog/liquibase.properties