CI Check for blue-krill #186
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 Check for blue-krill | |
on: | |
push: | |
branches: [master, staging] | |
paths: | |
- "sdks/blue-krill/**" | |
pull_request: | |
branches: [master, staging] | |
paths: | |
- "sdks/blue-krill/**" | |
workflow_dispatch: | |
release: | |
types: [published] | |
jobs: | |
check: | |
runs-on: macos-latest | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Format with isort | |
run: | | |
pip install isort==5.12.0 | |
isort sdks/ --settings-path=sdks/blue-krill/pyproject.toml | |
- name: Format with black | |
run: | | |
pip install black==23.7.0 click==8.1.6 | |
black sdks/ --config=sdks/blue-krill/pyproject.toml | |
- name: Lint with flake8 | |
run: | | |
pip install flake8==4.0.1 pyproject-flake8==0.0.1a5 | |
pflake8 sdks/ --config=sdks/blue-krill/pyproject.toml | |
- name: Lint with mypy | |
run: | | |
pip install mypy==0.910 types-requests==2.31.0.2 types-setuptools==57.4.18 types-dataclasses==0.1.7 types-redis==3.5.18 types-PyMySQL==1.1.0.1 types-six==0.1.9 types-toml==0.1.5 | |
mypy sdks/blue-krill --config-file=sdks/blue-krill/pyproject.toml | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.5.1 | |
- name: Start Redis Container | |
uses: supercharge/[email protected] | |
if: runner.os == 'Linux' | |
with: | |
redis-version: 3.2.0 | |
- name: Set Redis URL | |
if: runner.os == 'Linux' | |
run: | | |
echo "REDIS_URL=redis://localhost:6379/0" >> $GITHUB_ENV | |
- name: Install dependencies | |
working-directory: sdks/blue-krill | |
run: | | |
poetry export --without-hashes --dev -o requirements-dev.txt | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-dev.txt | |
python -m pip install tox-gh-actions==2.8.1 | |
- name: Run test with tox targets for ${{ matrix.python-version }} | |
working-directory: sdks/blue-krill | |
run: tox | |
build: | |
runs-on: macos-latest | |
if: github.event.release && contains(github.event.release.tag_name, 'blue_krill') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Set up Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.5.1 | |
- name: Build blue-krill | |
run: | | |
cd sdks/blue-krill | |
poetry install | |
poetry build | |
echo "${{ github.event.release.tag_name }} ${{ github.sha }}" > Release.txt | |
cat Release.txt | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
Release.txt | |
sdks/blue-krill/dist/* |