Skip to content

Commit

Permalink
feat: create github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrosjean committed Oct 9, 2023
1 parent 0d5d532 commit 134d222
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test

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

env:
PACKAGE_DIR: powerbi_ext
TESTS_DIR: tests

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Pytest
run: pip install pytest pytest-cov

- name: Test with pytest
run: pytest --cov=$PACKAGE_DIR $TESTS_DIR

lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install pylint
run: pip install pylint

- name: Lint with pylint
run: pylint --jobs 0 $PACKAGE_DIR --fail-under 9

format:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install black
run: pip install black

- name: Check format with black
run: black --check $PACKAGE_DIR

0 comments on commit 134d222

Please sign in to comment.