Update snowflake-docker.yml #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker tests | ||
run-name: ${{ github.actor }} is running the test schedules. | ||
on: | ||
push: | ||
branches: | ||
- GH_actions_test | ||
jobs: | ||
run-scripts: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04] | ||
pgver: [14, 15, 16, 17] | ||
runs-on: ${{ matrix.os }} | ||
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 #Use version specific alpine version of dockerfile | ||
run: | | ||
docker build --build-arg PGVER=${{ matrix.pgver }} -t snowflake . | ||
- 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 \ | ||
libpq-dev \ | ||
python3-dev \ | ||
python3-psycopg2 \ | ||
python3-dotenv | ||
until "pg_isready -p 59${{ matrix.pgver }}" 2>/dev/null; do >&2 echo "Postgres is unavailable - sleeping for 2 seconds" | ||
sleep 2 | ||
- name: Run Docker Container | ||
run: | | ||
docker run -d --name snowflake -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 snowflake | ||
- 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 | ||
cat latest.log | ||
- name: Upload Log File as Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: latest-log-${{ matrix.pgver }} | ||
path: latest.log |