Add poetry for easiness publishing #38
Workflow file for this run
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
# Checks that we can build and validate the Unittest | |
name: GitHub CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# python-version: [3.8] | |
python-version: [3.8, 3.9, "3.10"] | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry 1.8.3 | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
export PATH="$HOME/.local/bin:$PATH" | |
poetry self update 1.8.3 | |
- id: 'auth' | |
name: 'Authenticate to Google Cloud' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' | |
# Optional: Debugging step to confirm credentials are set | |
- name: Verify GCP Credentials | |
run: echo $GOOGLE_APPLICATION_CREDENTIALS | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}' | |
- name: Install Dependencies | |
run: poetry install | |
- name: Run Tests | |
run: poetry run pytest --cov=gcp_io --cov-report=term-missing --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v2 |