Skip to content

Commit

Permalink
add Ci and deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien committed Dec 6, 2023
1 parent ebf2a0f commit ce02b30
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 23 deletions.
42 changes: 19 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application
name: CI

on:
push:
branches: [ "main" ]
branches: [ main ]
pull_request:
branches: [ "main" ]
branches: [ main ]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}-latest
report:
runs-on: Ubuntu-latest
strategy:
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.8', '3.9', '3.10']
python-version: [3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
python-version: ${{ matrix.python-version }}

- name: Install packages
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
- name: Test folie
run: |
pytest
pytest --cov=folie --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Test and deploy

on:
push:
branches: [ "release" ]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest

0 comments on commit ce02b30

Please sign in to comment.