Skip to content

CI

CI #269

Workflow file for this run

# Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
---
name: CI
on:
schedule:
- cron: "0 3 * * *"
push:
branches:
- "*"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check -l 119"
src: "."
test:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install --with dev
- name: Run tests
run: poetry run pytest -v
release:
needs: test
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install --with dev
- name: Upload to PyPI
run: |
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Upload to GitHub
uses: softprops/action-gh-release@v1
with:
files: dist/*