feat: add poetry #68
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: Python build | |
on: [push] | |
env: | |
JETBRAINS_MONO_VERSION: 2.304 | |
PYTHON_VERSION: "3.8" | |
jobs: | |
setup: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache Python virtual environment | |
id: pip-cache | |
uses: actions/cache@v3 | |
with: | |
path: ./venv | |
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./requirements*.txt') }} | |
- name: Install Python requirements | |
if: steps.pip-cache.outputs.cache-hit != 'true' | |
run: | | |
python3 -m venv venv | |
source venv/bin/activate | |
pip install -r ./requirements.txt -r ./requirements-code-style.txt -r ./requirements-test.txt | |
code-style: | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache Python virtual environment | |
id: pip-cache | |
uses: actions/cache@v3 | |
with: | |
path: ./venv | |
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./requirements*.txt') }} | |
- name: Run Flake8 | |
run: | | |
source ./venv/bin/activate | |
flake8 . --count --statistics --config ./.flake8 | |
- name: Run Black | |
uses: psf/black@stable | |
with: | |
options: "-S --line-length 120 --target-version py38 --check --diff --color" | |
test: | |
needs: code-style | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache Python virtual environment | |
id: pip-cache | |
uses: actions/cache@v3 | |
with: | |
path: ./venv | |
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./requirements*.txt') }} | |
- name: Install anderson | |
run: | | |
source ./venv/bin/activate | |
pip install . | |
- name: Download JetBrains Mono | |
run: | | |
curl -sLO https://github.com/JetBrains/JetBrainsMono/releases/download/v$JETBRAINS_MONO_VERSION/JetBrainsMono-$JETBRAINS_MONO_VERSION.zip | |
unzip JetBrainsMono-$JETBRAINS_MONO_VERSION.zip | |
- name: Install JetBrains Mono on MacOS | |
if: matrix.os == 'macos-latest' | |
run: cp fonts/ttf/JetBrainsMono-Regular.ttf /Library/Fonts/ | |
- name: Install JetBrains Mono on Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo cp fonts/ttf/JetBrainsMono-Regular.ttf /usr/local/share/fonts/ | |
fc-cache -f -v | |
- name: Test anderson | |
run: | | |
source ./venv/bin/activate | |
pytest . -vv |