diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..11bcd49 --- /dev/null +++ b/.github/workflows/test.yml @@ -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