[#patch] Allow Pydantic 2.x #160
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
name: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
jobs: | |
test: | |
name: Install, lint and test | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.4 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction | |
- name: Run the linter | |
run: | | |
source .venv/bin/activate | |
./scripts/lint.sh | |
- name: Run the test | |
run: | | |
source .venv/bin/activate | |
./scripts/test.sh | |
tag: | |
name: Create new release | |
runs-on: ubuntu-20.04 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: [ test ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: '0' | |
# When https://github.com/anothrNick/github-tag-action/issues/150 will be closed, we should be able to use | |
# newer version of anothrNick/github-tag-action (post 1.39.0) which should include this step. | |
- name: git config | |
run: | | |
git config --global --add safe.directory /github/workspace | |
- name: Dry bump version and push tag | |
id: dry-bump-tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DRY_RUN: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: 1.8.4 | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Commit the new version of the python package | |
env: | |
NEW_TAG: ${{ steps.dry-bump-tag.outputs.new_tag }} | |
run: | | |
git config user.name "GitHub Actions Bot" | |
git config user.email "[email protected]" | |
poetry version ${NEW_TAG} | |
git add pyproject.toml | |
git commit -m "[tag] version ${NEW_TAG}" | |
git push origin main | |
- name: Push tag | |
id: push-tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true |