Skip to content

Add error handling for BCP utility check #63

Add error handling for BCP utility check

Add error handling for BCP utility check #63

Workflow file for this run

name: CI
on:
push:
branches: [master]
paths:
- ./github/workflows/**
- bcpandas/**
pull_request:
paths:
- bcpandas/**
workflow_dispatch:
inputs:
reason:
description: "Reason for triggering the workflow"
required: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Run Tests - Python ${{ matrix.python-version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --only main,test
- name: Pull MSSQL server Docker image
run: docker pull mcr.microsoft.com/mssql/server:2022-latest
- name: Install BCP Utility
run: |
# https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-ver15#ubuntu
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
- name: Test BCP
run: bcp -v
- name: Run tests
run: poetry run python -m pytest -x --cov-report=xml tests
- name: Upload codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml