From 295fbb96c136dcdeca08cc3e2d00abe366bc3bd0 Mon Sep 17 00:00:00 2001 From: "asdawsd@cwewc.cew" Date: Sat, 21 Dec 2024 13:02:47 +0700 Subject: [PATCH] tests workflow --- .github/workflows/python-tests.yml | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/python-tests.yml diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..112d314 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,42 @@ +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - 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 + - name: Build lib + run: | + pip install . + + - name: Test with pytest + run: | + pytest \ No newline at end of file