Skip to content

Recompute

Recompute #206

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
paths:
- "cncmark/**"
- "server/**"
pull_request:
workflow_dispatch:
jobs:
# mark:
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.11"]
# poetry-version: ["1.5.1"]
# os: [ubuntu-latest]
# runs-on: ${{ matrix.os }}
# defaults:
# run:
# working-directory: cncmark
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Run MySQL
# run: |
# docker-compose up -d mysql
# working-directory: .
# - name: Run image
# uses: abatilo/actions-poetry@v2
# with:
# poetry-version: ${{ matrix.poetry-version }}
# - name: Setup a local virtual environment (if no poetry.toml file)
# run: |
# poetry config virtualenvs.create true --local
# poetry config virtualenvs.in-project true --local
# - uses: actions/cache@v3
# name: Define a cache for the virtual environment based on the dependencies lock file
# with:
# path: ./.venv
# key: venv-${{ hashFiles('poetry.lock') }}
# - name: Install the project dependencies
# run: poetry install
# - name: Format with black
# run: |
# poetry run black --check cncmark tests
# - name: Lint with ruff
# run: |
# # stop the build if there are Python syntax errors or undefined names
# poetry run ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
# # default set of ruff rules with GitHub Annotations
# poetry run ruff --format=github --target-version=py37 .
# - name: Run the automated tests
# run: poetry run pytest -v --cov=cncmark
server:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
poetry-version: ["1.5.1"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run MySQL & Mosquitto
run: |
docker-compose up -d mysql mosquitto
working-directory: .
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Format with black
run: |
poetry run black --check server tests
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
# default set of ruff rules with GitHub Annotations
poetry run ruff --format=github --target-version=py37 .
- name: Run the automated tests
run: poetry run pytest -v --cov=server
docker:
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- name: Docker Build
run: |
docker build .