Skip to content

Commit

Permalink
wip adding docker for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejasvi Kashi authored and Tejasvi Kashi committed Jan 16, 2025
1 parent e1c899a commit df7b3f1
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM postgres:16-alpine

RUN apk add --no-cache \
make \
gcc \
musl-dev \
postgresql-dev \
git \
clang \
llvm

WORKDIR /home/postgres/snowflake

COPY . /home/postgres/snowflake/

RUN USE_PGXS=1 make && USE_PGXS=1 make install

EXPOSE 5432

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["postgres"]
47 changes: 47 additions & 0 deletions .github/workflows/snowflake-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test Docker Image

on:
push:
branches:
- main
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout snowflake
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Set up Docker
uses: docker/setup-buildx-action@v2

- name: Build Docker Image
run: |
docker build --progress plain -t snowflake .
- name: Run Docker Container
run: |
docker run -d --name snowflake-container -e POSTGRES_PASSWORD=password -p 5432:5432 snowflake-test
sleep 5
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
sudo apt -y update
sudo apt install -y postgresql-client-${{ matrix.pgver }} \
libpq-dev \
python3-dev \
python3-psycopg2 \
python3-dotenv
- name: Run Test Harness (runner.py)
run: |
python test/runner.py -c test/t/lib/${{ matrix.pgver }}config.env -s test/schedule_files/script_file -k

0 comments on commit df7b3f1

Please sign in to comment.