dependabot[bot] 6c4a40e1f7
Bump actions/checkout from 3.5.2 to 3.5.3 (#333)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.2...v3.5.3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-10 07:21:05 -04:00

81 lines
2.5 KiB
YAML

name: build
on:
push:
release:
types: [created, published]
env:
POETRY_VERSION: 1.2.2
jobs:
skip-check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5.3.0
with:
concurrent_skipping: 'same_content'
do_not_skip: '["release", "workflow_dispatch", "schedule"]'
lint:
needs: skip-check
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v4.6.1
with:
python-version: '3.x'
- name: Lint with Pre-commit
uses: pre-commit/action@v3.0.0
test:
needs: lint
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
max-parallel: 4
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3.5.3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry==$POETRY_VERSION
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install --no-interaction
- name: Test
run: poetry run pytest --cov=generic
- name: Code Climate Coverage Action
uses: paambaati/codeclimate-action@v4.0.0
env:
CC_TEST_REPORTER_ID: f9441442730130d385df69241a779ac3b663756ed21881179826e3fab7e01924
with:
coverageCommand: poetry run coverage xml
- name: Build (release only)
if: github.event_name == 'release' && matrix.python-version == '3.11'
run: poetry build
- name: Upload Assets (release only)
uses: AButler/upload-release-assets@v2.0
if: github.event_name == 'release' && matrix.python-version == '3.11'
with:
files: "dist/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI (release only)
if: github.event_name == 'release' && matrix.python-version == '3.11'
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}