Skip to content

ci: update workflows with latest troubleshooting and fixes (#22) #65

ci: update workflows with latest troubleshooting and fixes (#22)

ci: update workflows with latest troubleshooting and fixes (#22) #65

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install .
- name: Run tests
run: |
pytest --maxfail=1 --disable-warnings
tag-version:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Test GH_TOKEN permissions
run: |
curl -v -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}
shell: bash
- name: Set git user for hawkdeploy
run: |
git config user.name "${{ secrets.GH_DEPLOY_USER }}"
git config user.email "${{ secrets.GH_DEPLOY_EMAIL }}"
- name: Set up git for pushing
run: |
git remote set-url origin https://${{ secrets.GH_DEPLOY_USER }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git
- name: Show git user and remote
run: |
git config --get user.name
git config --get user.email
git remote -v
- name: Show current branch and HEAD
run: |
git branch -a
git status
git rev-parse --abbrev-ref HEAD
- name: Get version from pyproject.toml
id: get_version
run: |
VERSION=$(grep '^version =' pyproject.toml | head -1 | cut -d '"' -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create and push tag for current version (with verbose logging)
run: |
git remote -v
git tag v${{ steps.get_version.outputs.version }}
git fetch origin --tags --verbose
GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push origin v${{ steps.get_version.outputs.version }}
bump-version:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: [test, tag-version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set git user for hawkdeploy
run: |
git config user.name "${{ secrets.GH_DEPLOY_USER }}"
git config user.email "${{ secrets.GH_DEPLOY_EMAIL }}"
- name: Set up git for pushing
run: |
git remote set-url origin https://${{ secrets.GH_DEPLOY_USER }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git
- name: Bump patch version with bumpver
run: bumpver update --patch --commit
- name: Push version bump commit
run: |
git push