Skip to content

fix: fix POETRY_HOME #73

fix: fix POETRY_HOME

fix: fix POETRY_HOME #73

Workflow file for this run

name: Python build
on: [push]
env:
POETRY_HOME: ~/poetry
POETRY_VERSION: 1.7.1
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 Poetry
id: poetry-cache
uses: actions/cache@v3
with:
path: $POETRY_HOME
key: ${{ runner.os }}-poetry-cache-$POETRY_VERSION
- name: Install Poetry
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: |
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip3 install poetry==$POETRY_VERSION
- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}
- name: Install requirements
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
source $POETRY_HOME/bin/activate
poetry install
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 Poetry
id: poetry-cache
uses: actions/cache@v3
with:
path: $POETRY_HOME
key: ${{ runner.os }}-poetry-cache-$POETRY_VERSION
- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}
- name: Run Flake8
run: |
source $POETRY_HOME/bin/activate
poetry run 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 Poetry
id: poetry-cache
uses: actions/cache@v3
with:
path: $POETRY_HOME
key: ${{ runner.os }}-poetry-cache-$POETRY_VERSION
- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}
- 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 $POETRY_HOME/bin/activate
poetry run pytest . -vv