try to fix CI #76
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: | |
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 | |
key: ${{ runner.os }}-poetry-cache-${{ env.POETRY_VERSION }} | |
- name: Install Poetry | |
if: steps.poetry-cache.outputs.cache-hit != 'true' | |
run: | | |
python3 -m venv ./poetry | |
./poetry/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/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 | |
key: ${{ runner.os }}-poetry-cache-${{ env.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/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 | |
key: ${{ runner.os }}-poetry-cache-${{ env.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/bin/activate | |
poetry run pytest . -vv |