From a2e10b2b6756e84c1064b75578976870426a9717 Mon Sep 17 00:00:00 2001 From: Alexander Trotsenko Date: Fri, 31 May 2024 09:08:13 +0300 Subject: [PATCH 1/4] Create python-app.yml for GitHub Actions --- .github/workflows/python-app.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..4b1a540 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -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: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - 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 unittest + 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 + # 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 unittest + run: | + python test_engines.py From cfbeb90f88630c7702edc96292e486f0fa16c0df Mon Sep 17 00:00:00 2001 From: Alexander Trotsenko Date: Fri, 31 May 2024 09:13:01 +0300 Subject: [PATCH 2/4] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4b1a540..3622f4d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 unittest + pip install flake8 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | From 1ceb99ed44aa8a1239937e8cea55194aae4e6e0f Mon Sep 17 00:00:00 2001 From: Alexander Trotsenko Date: Fri, 31 May 2024 09:20:25 +0300 Subject: [PATCH 3/4] Update python-app.yml --- .github/workflows/python-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3622f4d..0483618 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,6 +25,7 @@ jobs: python-version: "3.10" - name: Install dependencies run: | + sudo apt install libopengl0 -y python -m pip install --upgrade pip pip install flake8 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi From 41eb46cf586e86e079df66bb8cdd67e92d16b022 Mon Sep 17 00:00:00 2001 From: Alexander Trotsenko Date: Fri, 31 May 2024 09:28:35 +0300 Subject: [PATCH 4/4] Update python-app.yml --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0483618..de95e28 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,7 +25,7 @@ jobs: python-version: "3.10" - name: Install dependencies run: | - sudo apt install libopengl0 -y + sudo apt install -y freeglut3 freeglut3-dev python -m pip install --upgrade pip pip install flake8 if [ -f requirements.txt ]; then pip install -r requirements.txt; fi