Merge pull request #89 from koterpillar/strip-for-unzip #597
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 | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
jobs: | |
ci: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
docker: debian | |
python-version: "3.11" | |
- os: ubuntu-latest | |
docker: ubuntu | |
python-version: "3.11" | |
- os: ubuntu-latest | |
docker: fedora | |
python-version: "3.11" | |
- os: macos-latest | |
python-version: "3.11" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: ./install-dev | |
- name: Lint | |
run: ./lint | |
- name: Test | |
run: ./test-script | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCKER_IMAGE: ${{ matrix.docker }} | |
- name: Upload coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: .coverage* | |
coverage: | |
needs: ci | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: ./install-dev | |
- name: Download coverage | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage-data | |
- name: Coverage report | |
run: ./coverage-report | |
- name: Upload coverage report | |
run: poetry run coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
needs: ci | |
if: startsWith(github.ref, 'refs/tags/v') | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Calculate version | |
id: tag | |
uses: frabert/[email protected] | |
with: | |
pattern: '^refs/tags/' | |
string: ${{ github.ref }} | |
replace-with: '' | |
- name: Check version | |
run: | | |
[[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]] | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: ./install-dev | |
- name: Publish | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
poetry version ${{ steps.tag.outputs.replaced }} | |
poetry build | |
poetry publish |