Pip package for tutorial-vm
#7
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: Build and Test | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Google Cloud credentials | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ runner.temp }}/gcloud-key.json | |
run: | | |
echo "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}" > $GOOGLE_APPLICATION_CREDENTIALS | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --editable .[dev] | |
- name: Build package | |
run: | | |
python -m build | |
twine check dist/* | |
- name: Install package | |
run: | | |
pip install dist/*.whl | |
- name: Run tests | |
run: | | |
pytest tests/ | |
- name: Clean up credentials | |
run: rm -f $GOOGLE_APPLICATION_CREDENTIALS |