simplified CI workflows

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2023-01-26 15:14:36 +01:00
parent cfa3b6dcd4
commit 654a3786c0
No known key found for this signature in database
4 changed files with 124 additions and 89 deletions

124
.github/workflows/CI.yml vendored Normal file
View File

@ -0,0 +1,124 @@
# 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:
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: "."
audit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pip-audit
run: pip install --upgrade pip pip-audit
- name: Install dependencies
run: pip install .
- name: Create requirements.txt
run: pip freeze > requirements.txt
- name: Audit dependencies
run: pip-audit
test:
needs: lint, audit
runs-on: ubuntu-latest
env:
PLANETMINT_DATABASE_BACKEND: tarantool_db
PLANETMINT_DATABASE_HOST: localhost
PLANETMINT_DATABASE_PORT: 3303
PLANETMINT_SERVER_BIND: 0.0.0.0:9984
PLANETMINT_WSSERVER_HOST: 0.0.0.0
PLANETMINT_WSSERVER_ADVERTISED_HOST: localhost
PLANETMINT_TENDERMINT_HOST: localhost
PLANETMINT_TENDERMINT_PORT: 26657
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Prepare OS
run: sudo apt-get update && sudo apt-get install -y git zsh curl tarantool-common vim build-essential cmake
- name: Get Tendermint
run: wget https://github.com/tendermint/tendermint/releases/download/v0.34.15/tendermint_0.34.15_linux_amd64.tar.gz && tar zxf tendermint_0.34.15_linux_amd64.tar.gz
- name: Install Planetmint
run: pip install -e '.[dev]'
- name: Execute Tests
run: make test
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@v7
- name: Install dependencies
run: pip install -e '.[dev]' && pip install wheel && python setup.py bdist_wheel sdist
#run: poetry install --with dev
- name: Upload to PyPI
run: |
twine check dist/*
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
#run: |
# poetry build
# poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Upload to GitHub
uses: softprops/action-gh-release@v1
with:
files: dist/*

View File

@ -1,17 +0,0 @@
# 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: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check -l 119"
src: "."

View File

@ -1,30 +0,0 @@
name: Deploy packages
on:
push:
tags:
- '*'
jobs:
build:
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: Install dependencies
run: pip install -e '.[dev]' && pip install wheel && python setup.py bdist_wheel sdist
- name: Upload to TestPyPI
run: |
twine check dist/*
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

View File

@ -1,42 +0,0 @@
# 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: Unit tests
on: [push, pull_request]
jobs:
unified-unit-tests:
runs-on: ubuntu-latest
env:
PLANETMINT_DATABASE_BACKEND: tarantool_db
PLANETMINT_DATABASE_HOST: localhost
PLANETMINT_DATABASE_PORT: 3303
PLANETMINT_SERVER_BIND: 0.0.0.0:9984
PLANETMINT_WSSERVER_HOST: 0.0.0.0
PLANETMINT_WSSERVER_ADVERTISED_HOST: localhost
PLANETMINT_TENDERMINT_HOST: localhost
PLANETMINT_TENDERMINT_PORT: 26657
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Prepare OS
run: sudo apt-get update && sudo apt-get install -y git zsh curl tarantool-common vim build-essential cmake
- name: Get Tendermint
run: wget https://github.com/tendermint/tendermint/releases/download/v0.34.15/tendermint_0.34.15_linux_amd64.tar.gz && tar zxf tendermint_0.34.15_linux_amd64.tar.gz
- name: Install Planetmint
run: pip install -e '.[dev]'
- name: Execute Tests
run: make test